]> git.buserror.net Git - polintos/scott/priv.git/blob - Makefile.head
fixes/cleanup
[polintos/scott/priv.git] / Makefile.head
1 # Makefile.head -- the initial portion of a generic makefile
2 # framework to be included at the top directory of each component. 
3 #
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.
14 #
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.
19 #
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`).
24 #
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
34 # .cc file.
35
36 TARGET := $(TOP)/Makefile.target
37
38 ifeq ($(TARGET),$(wildcard $(TARGET)))
39 include $(TARGET)
40 endif
41
42 CXXINCS += -I$(TOP)/include/c++ -I$(GENINCLUDES)/c++ \
43            -I$(TOP)/include/c -I$(TOP)/include/c/std \
44            -I$(BUILDDIR)/include
45
46 CINCS += -I$(TOP)/include/c -I$(TOP)/include/c/std \
47          -I$(BUILDDIR)/include
48
49 WARN += -Wall -Werror
50 OPT += -O2
51 DEBUG += -g3
52 ABI += -freg-struct-return
53
54 CXXFLAGS += $(DEFS) $(CXXINCS) $(CXXWARN) $(OPT) $(DEBUG) $(ABI)
55 BUILDCXXFLAGS += $(BUILDDEFS) $(CXXWARN) $(OPT) $(DEBUG)
56
57 CFLAGS += $(CINCS) $(DEFS) $(CWARN) $(OPT) $(DEBUG) $(ABI)
58 BUILDCFLAGS += $(BUILDDEFS) $(CWARN) $(OPT) $(DEBUG)
59
60 .PHONY: all default rerun dep servers clean distclean
61 .SUFFIXES:
62
63 all: default
64
65 # Make sure "make" treats thse as the right type of variable
66 # when += is used later.
67 DIRS :=
68
69 CFILES :=
70 CXXFILES :=
71 ASFILES :=
72
73 GENCFILES :=
74 GENCXXFILES :=
75 GENASFILES :=
76
77 BUILDCFILES :=
78 BUILDCXXFILES :=
79
80 BUILDGENCFILES :=
81 BUILDGENCXXFILES :=