]> git.buserror.net Git - polintos/scott/priv.git/blob - Makefile.head
minor doc updates
[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 TFLAGS += -freg-struct-return # Target and ABI flags
53 ifeq ($(V),)
54         V := @
55 else
56         override V := 
57 endif
58
59 CXXFLAGS += $(DEFS) $(CXXINCS) $(CXXWARN) $(OPT) $(DEBUG) $(TFLAGS)
60 BUILDCXXFLAGS += $(BUILDDEFS) $(CXXWARN) $(OPT) $(DEBUG)
61
62 CFLAGS += $(CINCS) $(DEFS) $(CWARN) $(OPT) $(DEBUG) $(TFLAGS)
63 BUILDCFLAGS += $(BUILDDEFS) $(CWARN) $(OPT) $(DEBUG)
64
65 ASFLAGS += $(TFLAGS)
66 LDFLAGS += $(TFLAGS)
67
68 .PHONY: all default rerun dep servers clean distclean
69 .SUFFIXES:
70
71 all: default
72
73 # Make sure "make" treats thse as the right type of variable
74 # when += is used later.
75 DIRS :=
76
77 CFILES :=
78 CXXFILES :=
79 ASFILES :=
80
81 GENCFILES :=
82 GENCXXFILES :=
83 GENASFILES :=
84
85 BUILDCFILES :=
86 BUILDCXXFILES :=
87
88 BUILDGENCFILES :=
89 BUILDGENCXXFILES :=