1 # Makefile.head -- the initial portion of a generic makefile
2 # framework to be included at the top directory of each component.
4 # Before including this file, the TOP variable should be set to the
5 # absolute path of the top-level project directory, and the COMP
6 # variable should be set to the path to the component's top-level
7 # directory, relative to the project's top-level directory. After
8 # including this file, include the directory makefiles, and then
9 # include Makefile.tail. Before including Makefile.tail, TARGETS
10 # should be set to the default targets to be made when "make" is
11 # invoked with no arguments. The target rules themselves can be
12 # declared after Makefile.tail in order to use variables such as OBJS
13 # which are set in Makefile.tail.
15 # WARNING: These makefiles will not work if you have spaces in any
16 # pathnames, including any parent directory outside the project
17 # hierarchy. This is a limitation of GNU make (quoting things
18 # doesn't help). Sorry.
20 # The makefiles also probably won't work very well if the component
21 # directory is a symlink, and the top-level directory is the symbolic
22 # parent (i.e. dirname `pwd -L`) rather than the physical parent
23 # (i.e. dirname `pwd -P`).
25 # NOTE: due to suckage of make that I haven't figured out how to work
26 # around, you'll have to run make twice after you update a .cdl file
27 # in order to make sure that any code that includes the generated
28 # headers has been rebuilt. This is despite having an explicit
29 # dependency of the .cc file on the normal .h, of the normal .h on
30 # the generated .h, of the generated headers on the server directory,
31 # and of the server directory on the CDL file. The CDL->directory
32 # rule is used to generated the headers, but even if it's done
33 # specifically for the .cc file up the chain, it doesn't rebuild the
36 TARGET := $(TOP)/Makefile.target
38 ifeq ($(TARGET),$(wildcard $(TARGET)))
42 CXXINCS += -I$(TOP)/include/c++ -I$(GENINCLUDES)/c++ \
43 -I$(TOP)/include/c -I$(TOP)/include/c/std \
46 CINCS += -I$(TOP)/include/c -I$(TOP)/include/c/std \
52 ABI += -freg-struct-return
54 CXXFLAGS += $(DEFS) $(CXXINCS) $(CXXWARN) $(OPT) $(DEBUG) $(ABI)
55 BUILDCXXFLAGS += $(BUILDDEFS) $(CXXWARN) $(OPT) $(DEBUG)
57 CFLAGS += $(CINCS) $(DEFS) $(CWARN) $(OPT) $(DEBUG) $(ABI)
58 BUILDCFLAGS += $(BUILDDEFS) $(CWARN) $(OPT) $(DEBUG)
60 .PHONY: all default rerun dep servers clean distclean
65 # Make sure "make" treats thse as the right type of variable
66 # when += is used later.