TOP := $(shell dirname `pwd -P`) COMP := idlcomp BUILDTYPE := build ARCHINDEP := y include ../Makefile.head OPT := -O0 RAW_CXXFILES := main namespace types output input util targets BUILDCXXFILES += $(RAW_CXXFILES:%=$(DIR)%) RAW_CXXFILES := idlparse cdlparse scan BUILDGENCXXFILES += $(RAW_CXXFILES:%=$(DIR)%) include languages/c++/Makefile BUILDDEFS += -D__STDC_FORMAT_MACROS -D__STDC_VERSION__=199901 -I. -DBUILDDIR=$(BUILDDIR) # Flex's scanner triggers the unused warning. BUILDCXXFLAGS += -Wno-unused TARGETS := $(BUILDDIR)/idlc $(BUILDDIR)/scan.cc: scan.lex @echo $(COMP): "$<" @$(MKDIR) $(BUILDDIR) @$(FLEX) -o$(BUILDDIR)/scan.cc scan.lex # Some versions of bison will generate idlparse.cc.h based on an # output filename of idlparse.cc, and others will generate # idlparse.hh. There's no way I can find to specify which to use, so # the name has to be canonicalized after bison is run. $(BUILDDIR)/idlparse.cc: idlparse.y @echo $(COMP): "$<" @$(MKDIR) $(BUILDDIR) @$(BISON) -b idl -p idl_ --verbose -d idlparse.y -o $(BUILDDIR)/idlparse.cc @if [ -e $(BUILDDIR)/idlparse.hh ]; then \ $(MV) $(BUILDDIR)/idlparse.hh $(BUILDDIR)/idlparse.cc.h; \ fi $(BUILDDIR)/cdlparse.cc: cdlparse.y @echo $(COMP): "$<" @$(MKDIR) $(BUILDDIR) @$(BISON) -b cdl -p cdl_ --verbose -d cdlparse.y -o $(BUILDDIR)/cdlparse.cc @if [ -e $(BUILDDIR)/cdlparse.hh ]; then \ $(MV) $(BUILDDIR)/cdlparse.hh $(BUILDDIR)/cdlparse.cc.h; \ fi # These dependencies need dummy actions, or make will ignore them for # some reason. $(BUILDDIR)/idlparse.cc.h: $(BUILDDIR)/idlparse.cc @ $(BUILDDIR)/cdlparse.cc.h: $(BUILDDIR)/cdlparse.cc @ idlcclean: $(MAKE) -C tests clean $(RM) $(BUILDDIR)/?dlparse.* EXTRACLEAN += idlcclean $(BUILDDIR)/scan.o: $(BUILDDIR)/idlparse.cc.h export IDLC .PHONY: tests tests: $(MAKE) -C tests PREDEP := $(BUILDDIR)/idlparse.cc $(BUILDDIR)/cdlparse.cc include ../Makefile.tail $(BUILDDIR)/idlc: $(BUILDOBJS) @echo $(COMP): Linking $(COMP) @$(BUILDCXX) -o $(BUILDDIR)/idlc $(BUILDOBJS)