]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/preproc/Makefile
Changed the version numbers, but did not commit the Makefiles.
[postgresql] / src / interfaces / ecpg / preproc / Makefile
1 # $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.83 2002/03/11 12:56:02 meskes Exp $
2
3 subdir = src/interfaces/ecpg/preproc
4 top_builddir = ../../../..
5 include $(top_builddir)/src/Makefile.global
6
7 MAJOR_VERSION=2
8 MINOR_VERSION=10
9 PATCHLEVEL=0
10
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)\" 
15
16 ifeq ($(GCC), yes)
17 override CFLAGS += -Wno-error
18 endif
19
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
22
23 all: ecpg
24
25 ifdef SNPRINTF
26 OBJS+=$(top_builddir)/src/backend/port/snprintf.o
27
28 $(top_builddir)/src/backend/port/snprintf.o:
29         $(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
30 endif
31
32 ifdef STRDUP
33 OBJS+=$(top_builddir)/src/utils/strdup.o
34
35 $(top_builddir)/src/utils/strdup.o:
36         $(MAKE) -C $(top_builddir)/src/utils strdup.o
37 endif
38
39 ecpg: $(OBJS)
40         $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
41
42 $(srcdir)/preproc.c: $(srcdir)/preproc.h ;
43
44 $(srcdir)/preproc.h: preproc.y
45 ifdef YACC
46         $(YACC) -d $(YFLAGS) $<
47         mv -f y.tab.c $(srcdir)/preproc.c
48         mv -f y.tab.h $(srcdir)/preproc.h
49 else
50         @$(missing) bison $< $@
51 endif
52
53 $(srcdir)/pgc.c: pgc.l
54 ifdef FLEX
55         $(FLEX) $(FLEXFLAGS) -o'$@' $<
56 else
57         @$(missing) flex $< $@
58 endif
59
60 c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h
61
62
63 distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
64
65 install: all installdirs
66         $(INSTALL_PROGRAM) ecpg$(X) $(DESTDIR)$(bindir)
67
68 installdirs:
69         $(mkinstalldirs) $(DESTDIR)$(bindir)
70
71 uninstall:
72         rm -f $(DESTDIR)$(bindir)/ecpg$(X)
73
74 clean distclean:
75         rm -f *.o 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
80
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
83 # inadequate tools.
84 maintainer-clean: distclean
85         rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
86
87
88 depend dep: preproc.c pgc.c
89         $(CC) -MM $(CFLAGS) *.c >depend
90
91 ifeq (depend,$(wildcard depend))
92 include depend
93 endif