Makefile 1.41 KB
Newer Older
1 2
SRCDIR= ../../..
include $(SRCDIR)/Makefile.global
3

Michael Meskes's avatar
Michael Meskes committed
4 5
MAJOR_VERSION=2
MINOR_VERSION=6
Michael Meskes's avatar
Michael Meskes committed
6
PATCHLEVEL=4
7

8 9
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
	-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
10
	-DINCLUDE_PATH=\"$(HEADERDIR)\"
Marc G. Fournier's avatar
Marc G. Fournier committed
11

Michael Meskes's avatar
Michael Meskes committed
12
OBJ=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o \
Marc G. Fournier's avatar
Marc G. Fournier committed
13
    keywords.o c_keywords.o ../lib/typename.o
Michael Meskes's avatar
Michael Meskes committed
14
#../../../backend/parser/scansup.o
15 16 17

all:: ecpg

18 19 20 21 22
preproc.c preproc.h: preproc.y
	$(YACC) $(YFLAGS) $<
	mv y.tab.c preproc.c
	mv y.tab.h preproc.h

23
clean:
Tom Lane's avatar
Tom Lane committed
24 25 26 27 28
	rm -f *.o core a.out ecpg$(X) *~ *.output
# And the garbage that might have been left behind by partial build:
	rm -f y.tab.c y.tab.h lex.yy.c
# make clean does not remove preproc.c, preproc.h, pgc.c since we want
# to ship those files in the distribution, for people with inadequate tools.
29

30
install: all
31
	$(INSTALL) $(INSTL_EXE_OPTS) ecpg$(X) $(BINDIR)
32

33
uninstall:
34
	rm -f $(BINDIR)/ecpg
Bruce Momjian's avatar
Hi,  
Bruce Momjian committed
35

36
# Rule that really do something.
Marc G. Fournier's avatar
Marc G. Fournier committed
37
ecpg: $(OBJ)
38
	$(CC) -o ecpg $(OBJ) $(LEXLIB) $(LDFLAGS)
39

40 41
pgc.c: pgc.l
	$(LEX) $<
42 43 44
	sed -e 's/#define YY_BUF_SIZE .*/#define YY_BUF_SIZE 65536/' \
		<lex.yy.c >pgc.c
	rm -f lex.yy.c
45

46
preproc.o : preproc.h ../include/ecpgtype.h keywords.c c_keywords.c ecpg_keywords.c
47
type.o : ../include/ecpgtype.h
48 49 50 51
pgc.o : ../include/ecpgtype.h keywords.c c_keywords.c ecpg_keywords.c preproc.h
keywords.o: ../include/ecpgtype.h preproc.h
c_keywords.o: ../include/ecpgtype.h preproc.h 
ecpg_keywords.o: ../include/ecpgtype.h preproc.h 
Marc G. Fournier's avatar
Marc G. Fournier committed
52