aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/Makefile
blob: 169575e082d33c506ee707ba57349b6a95cfc23b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#-------------------------------------------------------------------------
#
# Makefile for parser
#
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.28 2000/07/19 16:29:50 petere Exp $
#
#-------------------------------------------------------------------------

subdir = src/backend/parser
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

ifeq ($(GCC), yes)
CFLAGS+= -Wno-error
endif

OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \
      parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
      parse_type.o parse_coerce.o parse_target.o scan.o scansup.o


all: SUBSYS.o

SUBSYS.o: $(OBJS)
	$(LD) $(LDREL) $(LDOUT) $@ $^

$(srcdir)/gram.c $(srcdir)/parse.h: gram.y
	$(YACC) -d $(YFLAGS) $<
	mv y.tab.c $(srcdir)/gram.c
	mv y.tab.h $(srcdir)/parse.h

$(srcdir)/scan.c: scan.l
	$(LEX) $(LFLAGS) $<
	mv lex.yy.c $@


analyze.o keywords.o parse_clause.o parse_expr.o scan.o: $(srcdir)/parse.h


# gram.c, parse.h, and scan.c are in the distribution tarball, so they
# are not cleaned here.
clean: 
	rm -f SUBSYS.o $(OBJS)
# And the garbage that might have been left behind by partial build:
	@rm -f y.tab.c y.tab.h lex.yy.c


# This is unusual:  We actually have to build some of the parts before
# we know what the header file dependencies are.  
dep depend: gram.c scan.c
	$(CC) -MM $(CFLAGS) *.c >depend

ifeq (depend,$(wildcard depend))
include depend
endif