1 # $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.83 2002/03/11 12:56:02 meskes Exp $
3 subdir = src/interfaces/ecpg/preproc
4 top_builddir = ../../../..
5 include $(top_builddir)/src/Makefile.global
11 override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
12 -DMAJOR_VERSION=$(MAJOR_VERSION) \
13 -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
14 -DINCLUDE_PATH=\"$(includedir)\"
17 override CFLAGS += -Wno-error
20 OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
21 keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
26 OBJS+=$(top_builddir)/src/backend/port/snprintf.o
28 $(top_builddir)/src/backend/port/snprintf.o:
29 $(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
33 OBJS+=$(top_builddir)/src/utils/strdup.o
35 $(top_builddir)/src/utils/strdup.o:
36 $(MAKE) -C $(top_builddir)/src/utils strdup.o
40 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
42 $(srcdir)/preproc.c: $(srcdir)/preproc.h ;
44 $(srcdir)/preproc.h: preproc.y
46 $(YACC) -d $(YFLAGS) $<
47 mv -f y.tab.c $(srcdir)/preproc.c
48 mv -f y.tab.h $(srcdir)/preproc.h
50 @$(missing) bison $< $@
53 $(srcdir)/pgc.c: pgc.l
55 $(FLEX) $(FLEXFLAGS) -o'$@' $<
57 @$(missing) flex $< $@
60 c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h
63 distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
65 install: all installdirs
66 $(INSTALL_PROGRAM) ecpg$(X) $(DESTDIR)$(bindir)
69 $(mkinstalldirs) $(DESTDIR)$(bindir)
72 rm -f $(DESTDIR)$(bindir)/ecpg$(X)
76 # garbage from partial builds
77 @rm -f y.tab.c y.tab.h
78 # garbage from development
79 @rm -f core a.out *~ *.output *.tab.c
81 # `make clean' does not remove preproc.c, preproc.h, or pgc.c since we
82 # want to ship those files in the distribution for people with
84 maintainer-clean: distclean
85 rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
88 depend dep: preproc.c pgc.c
89 $(CC) -MM $(CFLAGS) *.c >depend
91 ifeq (depend,$(wildcard depend))