]> git.buserror.net Git - polintos/scott/priv.git/blob - idlcomp/Makefile
Initial checkin from Perforce.
[polintos/scott/priv.git] / idlcomp / Makefile
1 TOP := $(shell dirname `pwd -P`)
2 COMP := idlcomp
3 BUILDTYPE := build
4 ARCHINDEP := y
5 include ../Makefile.head
6
7 OPT := -O0
8
9 RAW_CXXFILES := main namespace types output input util targets
10 BUILDCXXFILES += $(RAW_CXXFILES:%=$(DIR)%)
11
12 RAW_CXXFILES := idlparse cdlparse scan
13 BUILDGENCXXFILES += $(RAW_CXXFILES:%=$(DIR)%)
14
15 include languages/c++/Makefile
16
17 BUILDDEFS += -D__STDC_FORMAT_MACROS -D__STDC_VERSION__=199901 -I. -DBUILDDIR=$(BUILDDIR)
18
19 # Flex's scanner triggers the unused warning.
20 BUILDCXXFLAGS += -Wno-unused
21
22 TARGETS := $(BUILDDIR)/idlc
23         
24 $(BUILDDIR)/scan.cc: scan.lex
25         @echo $(COMP): "$<"
26         @$(MKDIR) $(BUILDDIR)
27         @$(FLEX) -o$(BUILDDIR)/scan.cc scan.lex
28
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.
33
34 $(BUILDDIR)/idlparse.cc: idlparse.y
35         @echo $(COMP): "$<"
36         @$(MKDIR) $(BUILDDIR)
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; \
40         fi
41
42 $(BUILDDIR)/cdlparse.cc: cdlparse.y
43         @echo $(COMP): "$<"
44         @$(MKDIR) $(BUILDDIR)
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; \
48         fi
49
50 # These dependencies need dummy actions, or make will ignore them for
51 # some reason.
52
53 $(BUILDDIR)/idlparse.cc.h: $(BUILDDIR)/idlparse.cc
54         @
55
56 $(BUILDDIR)/cdlparse.cc.h: $(BUILDDIR)/cdlparse.cc
57         @
58
59 idlcclean:
60         $(MAKE) -C tests clean
61         $(RM) $(BUILDDIR)/?dlparse.*
62
63 EXTRACLEAN += idlcclean
64
65 $(BUILDDIR)/scan.o: $(BUILDDIR)/idlparse.cc.h
66
67 export IDLC
68 .PHONY: tests
69 tests:
70         $(MAKE) -C tests
71
72 PREDEP := $(BUILDDIR)/idlparse.cc $(BUILDDIR)/cdlparse.cc
73
74 include ../Makefile.tail
75
76 $(BUILDDIR)/idlc: $(BUILDOBJS)
77         @echo $(COMP): Linking $(COMP)
78         @$(BUILDCXX) -o $(BUILDDIR)/idlc $(BUILDOBJS)