1 TOP := $(shell dirname `pwd -P`)
5 include ../Makefile.head
9 RAW_CXXFILES := main namespace types output input util targets
10 BUILDCXXFILES += $(RAW_CXXFILES:%=$(DIR)%)
12 RAW_CXXFILES := idlparse cdlparse scan
13 BUILDGENCXXFILES += $(RAW_CXXFILES:%=$(DIR)%)
15 include languages/c++/Makefile
17 BUILDDEFS += -D__STDC_FORMAT_MACROS -D__STDC_VERSION__=199901 -I. -DBUILDDIR=$(BUILDDIR)
19 # Flex's scanner triggers the unused warning.
20 BUILDCXXFLAGS += -Wno-unused
22 TARGETS := $(BUILDDIR)/idlc
24 $(BUILDDIR)/scan.cc: scan.lex
27 @$(FLEX) -o$(BUILDDIR)/scan.cc scan.lex
29 # Some versions of bison will generate idlparse.cc.h based on an
30 # output filename of idlparse.cc, and others will generate
31 # idlparse.hh. There's no way I can find to specify which to use, so
32 # the name has to be canonicalized after bison is run.
34 $(BUILDDIR)/idlparse.cc: idlparse.y
37 @$(BISON) -b idl -p idl_ --verbose -d idlparse.y -o $(BUILDDIR)/idlparse.cc
38 @if [ -e $(BUILDDIR)/idlparse.hh ]; then \
39 $(MV) $(BUILDDIR)/idlparse.hh $(BUILDDIR)/idlparse.cc.h; \
42 $(BUILDDIR)/cdlparse.cc: cdlparse.y
45 @$(BISON) -b cdl -p cdl_ --verbose -d cdlparse.y -o $(BUILDDIR)/cdlparse.cc
46 @if [ -e $(BUILDDIR)/cdlparse.hh ]; then \
47 $(MV) $(BUILDDIR)/cdlparse.hh $(BUILDDIR)/cdlparse.cc.h; \
50 # These dependencies need dummy actions, or make will ignore them for
53 $(BUILDDIR)/idlparse.cc.h: $(BUILDDIR)/idlparse.cc
56 $(BUILDDIR)/cdlparse.cc.h: $(BUILDDIR)/cdlparse.cc
60 $(MAKE) -C tests clean
61 $(RM) $(BUILDDIR)/?dlparse.*
63 EXTRACLEAN += idlcclean
65 $(BUILDDIR)/scan.o: $(BUILDDIR)/idlparse.cc.h
72 PREDEP := $(BUILDDIR)/idlparse.cc $(BUILDDIR)/cdlparse.cc
74 include ../Makefile.tail
76 $(BUILDDIR)/idlc: $(BUILDOBJS)
77 @echo $(COMP): Linking $(COMP)
78 @$(BUILDCXX) -o $(BUILDDIR)/idlc $(BUILDOBJS)