summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/Makefile.in
blob: 9d5aea9b70025bbb4b7d9e8b42409b3aa94ab906 (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
SRCDIR= ../../..
include $(SRCDIR)/Makefile.global

MAJOR_VERSION=2
MINOR_VERSION=7
PATCHLEVEL=1

CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
	-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
	-DINCLUDE_PATH=\"$(HEADERDIR)\" 

OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
    keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o

all:: ecpg

ifneq (@SNPRINTF@,)
OBJS+=$(SRCDIR)/backend/port/snprintf.o

$(SRCDIR)/backend/port/snprintf.o:
	$(MAKE) -C $(SRCDIR)/backend/port snprintf.o
endif

# Rule that really do something.
ecpg: $(OBJS)
	$(CC) -o ecpg $(OBJS) $(LEXLIB) $(LDFLAGS)

preproc.c preproc.h: preproc.y
	$(YACC) -d $(YFLAGS) $<
	mv y.tab.c preproc.c
	mv y.tab.h preproc.h

pgc.c: pgc.l
	$(LEX) $(LFLAGS) $<
	mv lex.yy.c pgc.c

clean:
	rm -f *.o core a.out ecpg$(X) *~ *.output *.tab.c
# 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.

install: all
	$(INSTALL) $(INSTL_EXE_OPTS) ecpg$(X) $(BINDIR)

uninstall:
	rm -f $(BINDIR)/ecpg

depend dep: preproc.c pgc.c
	$(CC) -MM $(CFLAGS) *.c >depend

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