Makefile 1.5 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for parser
4
#
5
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.32 2001/02/10 22:31:42 petere Exp $
6 7 8
#
#-------------------------------------------------------------------------

9 10 11
subdir = src/backend/parser
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
12

13
ifeq ($(GCC), yes)
14
override CFLAGS+= -Wno-error
15 16
endif

17 18
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 \
19
      parse_type.o parse_coerce.o parse_target.o scan.o scansup.o
20 21


22
all: SUBSYS.o
23

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

27
$(srcdir)/gram.c $(srcdir)/parse.h: gram.y
28
ifdef YACC
29
	$(YACC) -d $(YFLAGS) $<
30 31
	mv y.tab.c $(srcdir)/gram.c
	mv y.tab.h $(srcdir)/parse.h
32 33 34
else
	@$(missing) bison $< $@
endif
35

36
$(srcdir)/scan.c: scan.l
37
ifdef FLEX
38
	$(FLEX) $(FLEXFLAGS) -Pbase_yy -o'$@' $<
39 40 41
else
	@$(missing) flex $< $@
endif
42

43

44 45 46 47 48 49 50 51 52
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
53 54 55 56


# This is unusual:  We actually have to build some of the parts before
# we know what the header file dependencies are.  
Bruce Momjian's avatar
Hi,  
Bruce Momjian committed
57 58
dep depend: gram.c scan.c
	$(CC) -MM $(CFLAGS) *.c >depend
59 60 61 62

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