aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/Makefile.am
blob: 0478f1645aac11fe6e5b4bd3f8bb720ec451ae22 (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
56
57
58
59
60
61
62
SRCS = mhmakeparser.y mhmakelexer.l mhmake.cpp mhmakefileparser.cpp util.cpp \
       functions.cpp fileinfo.cpp rule.cpp md5.c build.cpp curdir.cpp \
       commandqueue.cpp

if DEBUG
bin_PROGRAMS=mhmake_dbg
mhmake_dbg_SOURCES = $(SRCS)
else
bin_PROGRAMS=mhmake
mhmake_SOURCES = $(SRCS)
endif

LEX=flex++
AM_LFLAGS=-8

YACC=bison++
AM_YFLAGS=-d

mhmakelexer.o: mhmakelexer.cpp mhmakelexer.h
mhmakelexer.cpp: mhmakelexer.l
mhmakelexer.h: mhmakelexer.l

mhmakeparser.o: mhmakeparser.cpp mhmakeparser.h
mhmakeparser.cpp: mhmakeparser.y
mhmakeparser.h: mhmakeparser.y

.l.cpp:
	$(LEXCOMPILE) -S$(srcdir)/flexskel.cc -H$(srcdir)/flexskel.h -h$(@:%.cpp=%.h) -otemp1234.456 $<
	echo '#include "stdafx.h"' > $@
	cat temp1234.456 >> $@
	rm temp1234.456

.y.cpp:
	$(YACCCOMPILE) -S$(srcdir)/bison.cc -H$(srcdir)/bison.h -h$(@:%.cpp=%.h) -otemp1234.456 $<
	echo '#include "stdafx.h"' > $@
	cat temp1234.456 >> $@
	rm temp1234.456


.l.h:
	$(LEXCOMPILE) -S$(srcdir)/flexskel.cc -H$(srcdir)/flexskel.h -h$@ -otemp1234.456 $<
	echo '#include "stdafx.h"' > $(@:%.h=%.cpp)
	cat temp1234.456 >> $(@:%.h=%.cpp)
	rm temp1234.456

.y.h:
	$(YACCCOMPILE) -S$(srcdir)/bison.cc -H$(srcdir)/bison.h -h$@ -otemp1234.456 $<
	echo '#include "stdafx.h"' > $(@:%.h=%.cpp)
	cat temp1234.456 >> $(@:%.h=%.cpp)
	rm temp1234.456

# set the include path found by configure
INCLUDES= $(all_includes)

LDADD = /usr/lib/libpopt.a

# the library search path.
if DEBUG
mhmake_dbg_LDFLAGS = $(all_libraries)
else
mhmake_LDFLAGS = $(all_libraries)
endif