Bug 609906: need to use explicit tz setting for broadcom mips machines (p=trbaker...
[tamarin-stm.git] / build / config.mk
blob429ae800bbb3dec9dd3862015cc55939f2353240
1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
12 # License.
14 # The Original Code is [Open Source Virtual Machine].
16 # The Initial Developer of the Original Code is
17 # Adobe System Incorporated.
18 # Portions created by the Initial Developer are Copyright (C) 2005-2006
19 # the Initial Developer. All Rights Reserved.
21 # Contributor(s):
23 # Alternatively, the contents of this file may be used under the terms of
24 # either the GNU General Public License Version 2 or later (the "GPL"), or
25 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 # in which case the provisions of the GPL or the LGPL are applicable instead
27 # of those above. If you wish to allow use of your version of this file only
28 # under the terms of either the GPL or the LGPL, and not to allow others to
29 # use your version of this file under the terms of the MPL, indicate your
30 # decision by deleting the provisions above and replace them with the notice
31 # and other provisions required by the GPL or the LGPL. If you do not delete
32 # the provisions above, a recipient may use your version of this file under
33 # the terms of any one of the MPL, the GPL or the LGPL.
35 # ***** END LICENSE BLOCK *****
37 GARBAGE :=
39 VPATH = $(topsrcdir)
41 curdir := .
42 srcdir := $(topsrcdir)
44 COMPILE_CPPFLAGS = $(CPPFLAGS) $(APP_CPPFLAGS)
45 COMPILE_CXXFLAGS = $(CXXFLAGS) $(APP_CXXFLAGS)
46 COMPILE_CFLAGS = $(CFLAGS) $(APP_CFLAGS)
48 ifdef ENABLE_DEBUG
49 COMPILE_CPPFLAGS += $(DEBUG_CPPFLAGS)
50 COMPILE_CXXFLAGS += $(DEBUG_CXXFLAGS)
51 COMPILE_CFLAGS += $(DEBUG_CFLAGS)
52 LDFLAGS += $(DEBUG_LDFLAGS)
53 else
54 COMPILE_CPPFLAGS += $(OPT_CPPFLAGS)
55 COMPILE_CXXFLAGS += $(OPT_CXXFLAGS)
56 COMPILE_CFLAGS += $(OPT_CFLAGS)
57 endif
59 ifdef MACOSX_DEPLOYMENT_TARGET
60 export MACOSX_DEPLOYMENT_TARGET
61 endif
63 GLOBAL_DEPS := Makefile
65 all::
67 # Usage: from within RECURSE_DIRS
68 # Variables:
69 # $(1) = $(curdir)
70 # $(2) = subdirectory
71 # Note: positional parameters passed to $(call) are expanded "early". This is
72 # the magic that sets and revert $(curdir) and $(srcdir) properly.
73 define RECURSE_DIR
74 curdir := $(1)/$(2)
75 srcdir := $(topsrcdir)/$$(curdir)
76 include $(topsrcdir)/$$(curdir)/manifest.mk
77 curdir := $(1)
78 endef
80 # Usage: $(call REAL_RECURSE_DIRS,$(DIRS),$(curdir))
81 define REAL_RECURSE_DIRS
82 $(foreach dir,$(1),$(eval $(call RECURSE_DIR,$(2),$(dir))))
83 endef
85 # Usage: $(call RECURSE_DIRS,$(DIRS)))
86 define RECURSE_DIRS
87 $(call REAL_RECURSE_DIRS,$(1),$(curdir))
88 endef
90 # Usage: $(eval $(call THING_SRCS,$(thingname)))
91 define THING_SRCS
92 $(1)_CPPFLAGS ?= $(COMPILE_CPPFLAGS)
93 $(1)_CXXFLAGS ?= $(COMPILE_CXXFLAGS)
94 $(1)_CFLAGS ?= $(COMPILE_CFLAGS)
95 $(1)_CPPFLAGS += $($(1)_EXTRA_CPPFLAGS)
96 $(1)_CXXFLAGS += $($(1)_EXTRA_CXXFLAGS)
97 $(1)_CFLAGS += $($(1)_EXTRA_CFLAGS)
98 $(1)_INCLUDES += $(INCLUDES)
99 $(1)_DEFINES += $(DEFINES)
101 $(1)_CXXOBJS = $$($(1)_CXXSRCS:%.cpp=%.$(OBJ_SUFFIX))
103 $(1)_COBJS = $$($(1)_CSRCS:%.c=%.$(OBJ_SUFFIX))
105 $(1)_ASMOBJS = $$($(1)_ASMSRCS:%.armasm=%.$(OBJ_SUFFIX))
107 $(1)_MASMOBJS = $$($(1)_MASMSRCS:%.asm=%.$(OBJ_SUFFIX))
109 GARBAGE += \
110 $$($(1)_CXXOBJS) \
111 $$($(1)_COBJS) \
112 $$($(1)_ASMOBJS) \
113 $$($(1)_MASMOBJS) \
114 $$($(1)_CXXOBJS:.$(OBJ_SUFFIX)=.$(II_SUFFIX)) \
115 $$($(1)_CXXOBJS:.$(OBJ_SUFFIX)=.deps) \
116 $$($(1)_COBJS:.$(OBJ_SUFFIX)=.$(II_SUFFIX)) \
117 $$($(1)_COBJS:.$(OBJ_SUFFIX)=.deps) \
118 $(NULL)
120 $$($(1)_CXXOBJS:.$(OBJ_SUFFIX)=.$(II_SUFFIX)): %.$(II_SUFFIX): %.cpp $$(GLOBAL_DEPS)
121 @test -d $$(dir $$@) || mkdir -p $$(dir $$@)
122 @echo "Compiling $$*"
123 @$(CXX) -E $$($(1)_CPPFLAGS) $$($(1)_CXXFLAGS) $$($(1)_DEFINES) $$($(1)_INCLUDES) $$< > $$@
124 @$(PYTHON) $(topsrcdir)/build/dependparser.py $$*.deps $$< < $$@ > /dev/null
126 $$($(1)_CXXOBJS): %.$(OBJ_SUFFIX): %.$(II_SUFFIX) $$(GLOBAL_DEPS)
127 @$(CXX) $(OUTOPTION)$$@ $$($(1)_CPPFLAGS) $$($(1)_CXXFLAGS) $$($(1)_DEFINES) $$($(1)_INCLUDES) -c $$<
129 $$($(1)_COBJS:.$(OBJ_SUFFIX)=.$(I_SUFFIX)): %.$(I_SUFFIX): %.c $$(GLOBAL_DEPS)
130 @test -d $$(dir $$@) || mkdir -p $$(dir $$@)
131 @echo "Compiling $$*"
132 @$(CC) -E $$($(1)_CPPFLAGS) $$($(1)_CFLAGS) $$($(1)_DEFINES) $$($(1)_INCLUDES) $$< > $$@
133 @$(PYTHON) $(topsrcdir)/build/dependparser.py $$*.deps $$< < $$@ > /dev/null
135 $$($(1)_COBJS): %.$(OBJ_SUFFIX): %.$(I_SUFFIX) $$(GLOBAL_DEPS)
136 @$(CC) $(OUTOPTION)$$@ $$($(1)_CPPFLAGS) $$($(1)_CFLAGS) $$($(1)_DEFINES) $$($(1)_INCLUDES) -c $$<
138 $$($(1)_ASMOBJS): %.$(OBJ_SUFFIX): %.armasm $$(GLOBAL_DEPS)
139 $(ASM) -o $$@ $$($(1)_ASMFLAGS) $$<
141 $$($(1)_MASMOBJS): %.$(OBJ_SUFFIX): %.asm $$(GLOBAL_DEPS)
142 $(MASM) -Fo $$@ $$($(1)_MASMFLAGS) $$<
144 $(1).thing.pp: FORCE
145 @$(PYTHON) $(topsrcdir)/build/calcdepends.py $$@ $$($(1)_CXXOBJS:.$(OBJ_SUFFIX)=.$(II_SUFFIX)) $$($(1)_COBJS:.$(OBJ_SUFFIX)=.$(I_SUFFIX))
147 include $(1).thing.pp
149 endef # THINGS_SRCS
151 # Usage: $(eval $(call STATIC_LIBRARY_RULES,$(static_library_thingname)))
152 define STATIC_LIBRARY_RULES
153 $(1)_BASENAME ?= $(1)
154 $(1)_NAME = $(LIB_PREFIX)$$($(1)_BASENAME).$(LIB_SUFFIX)
156 $$($(1)_DIR)$$($(1)_NAME): $$($(1)_CXXOBJS) $$($(1)_COBJS) $$($(1)_ASMOBJS) $$($(1)_MASMOBJS)
157 @echo "Library $$*"
158 $(call MKSTATICLIB,$$@) $$($(1)_CXXOBJS) $$($(1)_COBJS) $$($(1)_ASMOBJS) $$($(1)_MASMOBJS)
160 GARBAGE += $$($(1)_DIR)$$($(1)_NAME)
162 ifdef $(1)_BUILD_ALL
163 all:: $$($(1)_DIR)$$($(1)_NAME)
164 endif
166 endef
168 # Usage: $(eval $(call DLL_RULES,$(dll_thingname)))
169 define DLL_RULES
170 $(1)_BASENAME ?= $(1)
171 $(1)_NAME = $(LIB_PREFIX)$$($(1)_BASENAME).$(DLL_SUFFIX)
172 $(1)_DEPS = \
173 $$($(1)_EXTRA_DEPS) \
174 $$(foreach lib,$$($(1)_STATIC_LIBRARIES) $$($(1)_DLLS),$$($$(lib)_NAME)) \
175 $$(GLOBAL_DEPS) \
176 $(NULL)
177 $(1)_LDFLAGS = \
178 $$(LDFLAGS) \
179 $$($(1)_EXTRA_LDFLAGS) \
180 $$(foreach lib,$$(OS_LIBS),$(call EXPAND_LIBNAME,$$(lib))) \
181 $$(OS_LDFLAGS) \
182 $(NULL)
184 $$($(1)_DIR)$$($(1)_NAME): $$($(1)_CXXOBJS) $$($(1)_COBJS) $$($(1)_DEPS)
185 $(call MKDLL,$$@) $$($(1)_CXXOBJS) $$($(1)_COBJS) \
186 $(LIBPATH). $$(foreach lib,$$($(1)_STATIC_LIBRARIES),$$(call EXPAND_LIBNAME,$$(lib))) \
187 $$(foreach lib,$$($(1)_DLLS),$$(call EXPAND_DLLNAME,$$(lib))) \
188 $$($(1)_LDFLAGS)
190 GARBAGE += $$($(1)_DIR)$$($(1)_NAME)
192 ifdef $(1)_BUILD_ALL
193 all:: $$($(1)_DIR)$$($(1)_NAME)
194 endif
196 endef
198 # Usage: $(eval $(call PROGRAM_RULES,$(program_thingnaame)))
199 define PROGRAM_RULES
200 $(1)_BASENAME ?= $(1)
201 $(1)_NAME ?= $$($(1)_BASENAME)$(PROGRAM_SUFFIX)
202 $(1)_DEPS = \
203 $$($(1)_EXTRA_DEPS) \
204 $$(foreach lib,$$($(1)_STATIC_LIBRARIES) $$($(1)_DLLS),$$($$(lib)_NAME)) \
205 $$(GLOBAL_DEPS) \
206 $(NULL)
207 $(1)_LDFLAGS = \
208 $$(LDFLAGS) \
209 $$($(1)_EXTRA_LDFLAGS) \
210 $$(foreach lib,$$(OS_LIBS),$(call EXPAND_LIBNAME,$$(lib))) \
211 $$(OS_LDFLAGS) \
212 $(NULL)
214 $$($(1)_DIR)$$($(1)_NAME): $$($(1)_CXXOBJS) $$($(1)_DEPS)
215 @echo "Link $$@"
216 $(call MKPROGRAM,$$@) \
217 $$($(1)_CXXOBJS) \
218 $(LIBPATH). $$(foreach lib,$$($(1)_STATIC_LIBRARIES),$$(call EXPAND_LIBNAME,$$(lib))) \
219 $$(foreach lib,$$($(1)_DLLS),$$(call EXPAND_DLLNAME,$$(lib))) \
220 $$($(1)_LDFLAGS)
221 $(ifneq ($POSTMKPROGRAM,''))
222 $(call POSTMKPROGRAM,$$@)
224 GARBAGE += $$($(1)_DIR)$$($(1)_NAME)
226 ifdef $(1)_BUILD_ALL
227 all:: $$($(1)_DIR)$$($(1)_NAME)
228 endif
230 endef
232 .PHONY: all FORCE