xref: /aosp_15_r20/external/jemalloc_new/Makefile.in (revision 1208bc7e437ced7eb82efac44ba17e3beba411da)
1*1208bc7eSAndroid Build Coastguard Worker# Clear out all vpaths, then set just one (default vpath) for the main build
2*1208bc7eSAndroid Build Coastguard Worker# directory.
3*1208bc7eSAndroid Build Coastguard Workervpath
4*1208bc7eSAndroid Build Coastguard Workervpath % .
5*1208bc7eSAndroid Build Coastguard Worker
6*1208bc7eSAndroid Build Coastguard Worker# Clear the default suffixes, so that built-in rules are not used.
7*1208bc7eSAndroid Build Coastguard Worker.SUFFIXES :
8*1208bc7eSAndroid Build Coastguard Worker
9*1208bc7eSAndroid Build Coastguard WorkerSHELL := /bin/sh
10*1208bc7eSAndroid Build Coastguard Worker
11*1208bc7eSAndroid Build Coastguard WorkerCC := @CC@
12*1208bc7eSAndroid Build Coastguard WorkerCXX := @CXX@
13*1208bc7eSAndroid Build Coastguard Worker
14*1208bc7eSAndroid Build Coastguard Worker# Configuration parameters.
15*1208bc7eSAndroid Build Coastguard WorkerDESTDIR =
16*1208bc7eSAndroid Build Coastguard WorkerBINDIR := $(DESTDIR)@BINDIR@
17*1208bc7eSAndroid Build Coastguard WorkerINCLUDEDIR := $(DESTDIR)@INCLUDEDIR@
18*1208bc7eSAndroid Build Coastguard WorkerLIBDIR := $(DESTDIR)@LIBDIR@
19*1208bc7eSAndroid Build Coastguard WorkerDATADIR := $(DESTDIR)@DATADIR@
20*1208bc7eSAndroid Build Coastguard WorkerMANDIR := $(DESTDIR)@MANDIR@
21*1208bc7eSAndroid Build Coastguard Workersrcroot := @srcroot@
22*1208bc7eSAndroid Build Coastguard Workerobjroot := @objroot@
23*1208bc7eSAndroid Build Coastguard Workerabs_srcroot := @abs_srcroot@
24*1208bc7eSAndroid Build Coastguard Workerabs_objroot := @abs_objroot@
25*1208bc7eSAndroid Build Coastguard Worker
26*1208bc7eSAndroid Build Coastguard Worker# Build parameters.
27*1208bc7eSAndroid Build Coastguard WorkerCPPFLAGS := @CPPFLAGS@ -I$(objroot)include -I$(srcroot)include
28*1208bc7eSAndroid Build Coastguard WorkerCONFIGURE_CFLAGS := @CONFIGURE_CFLAGS@
29*1208bc7eSAndroid Build Coastguard WorkerSPECIFIED_CFLAGS := @SPECIFIED_CFLAGS@
30*1208bc7eSAndroid Build Coastguard WorkerEXTRA_CFLAGS := @EXTRA_CFLAGS@
31*1208bc7eSAndroid Build Coastguard WorkerCFLAGS := $(strip $(CONFIGURE_CFLAGS) $(SPECIFIED_CFLAGS) $(EXTRA_CFLAGS))
32*1208bc7eSAndroid Build Coastguard WorkerCONFIGURE_CXXFLAGS := @CONFIGURE_CXXFLAGS@
33*1208bc7eSAndroid Build Coastguard WorkerSPECIFIED_CXXFLAGS := @SPECIFIED_CXXFLAGS@
34*1208bc7eSAndroid Build Coastguard WorkerEXTRA_CXXFLAGS := @EXTRA_CXXFLAGS@
35*1208bc7eSAndroid Build Coastguard WorkerCXXFLAGS := $(strip $(CONFIGURE_CXXFLAGS) $(SPECIFIED_CXXFLAGS) $(EXTRA_CXXFLAGS))
36*1208bc7eSAndroid Build Coastguard WorkerLDFLAGS := @LDFLAGS@
37*1208bc7eSAndroid Build Coastguard WorkerEXTRA_LDFLAGS := @EXTRA_LDFLAGS@
38*1208bc7eSAndroid Build Coastguard WorkerLIBS := @LIBS@
39*1208bc7eSAndroid Build Coastguard WorkerRPATH_EXTRA := @RPATH_EXTRA@
40*1208bc7eSAndroid Build Coastguard WorkerSO := @so@
41*1208bc7eSAndroid Build Coastguard WorkerIMPORTLIB := @importlib@
42*1208bc7eSAndroid Build Coastguard WorkerO := @o@
43*1208bc7eSAndroid Build Coastguard WorkerA := @a@
44*1208bc7eSAndroid Build Coastguard WorkerEXE := @exe@
45*1208bc7eSAndroid Build Coastguard WorkerLIBPREFIX := @libprefix@
46*1208bc7eSAndroid Build Coastguard WorkerREV := @rev@
47*1208bc7eSAndroid Build Coastguard Workerinstall_suffix := @install_suffix@
48*1208bc7eSAndroid Build Coastguard WorkerABI := @abi@
49*1208bc7eSAndroid Build Coastguard WorkerXSLTPROC := @XSLTPROC@
50*1208bc7eSAndroid Build Coastguard WorkerAUTOCONF := @AUTOCONF@
51*1208bc7eSAndroid Build Coastguard Worker_RPATH = @RPATH@
52*1208bc7eSAndroid Build Coastguard WorkerRPATH = $(if $(1),$(call _RPATH,$(1)))
53*1208bc7eSAndroid Build Coastguard Workercfghdrs_in := $(addprefix $(srcroot),@cfghdrs_in@)
54*1208bc7eSAndroid Build Coastguard Workercfghdrs_out := @cfghdrs_out@
55*1208bc7eSAndroid Build Coastguard Workercfgoutputs_in := $(addprefix $(srcroot),@cfgoutputs_in@)
56*1208bc7eSAndroid Build Coastguard Workercfgoutputs_out := @cfgoutputs_out@
57*1208bc7eSAndroid Build Coastguard Workerenable_autogen := @enable_autogen@
58*1208bc7eSAndroid Build Coastguard Workerenable_prof := @enable_prof@
59*1208bc7eSAndroid Build Coastguard Workerenable_zone_allocator := @enable_zone_allocator@
60*1208bc7eSAndroid Build Coastguard WorkerMALLOC_CONF := @JEMALLOC_CPREFIX@MALLOC_CONF
61*1208bc7eSAndroid Build Coastguard Workerlink_whole_archive := @link_whole_archive@
62*1208bc7eSAndroid Build Coastguard WorkerDSO_LDFLAGS = @DSO_LDFLAGS@
63*1208bc7eSAndroid Build Coastguard WorkerSOREV = @SOREV@
64*1208bc7eSAndroid Build Coastguard WorkerPIC_CFLAGS = @PIC_CFLAGS@
65*1208bc7eSAndroid Build Coastguard WorkerCTARGET = @CTARGET@
66*1208bc7eSAndroid Build Coastguard WorkerLDTARGET = @LDTARGET@
67*1208bc7eSAndroid Build Coastguard WorkerTEST_LD_MODE = @TEST_LD_MODE@
68*1208bc7eSAndroid Build Coastguard WorkerMKLIB = @MKLIB@
69*1208bc7eSAndroid Build Coastguard WorkerAR = @AR@
70*1208bc7eSAndroid Build Coastguard WorkerARFLAGS = @ARFLAGS@
71*1208bc7eSAndroid Build Coastguard WorkerDUMP_SYMS = @DUMP_SYMS@
72*1208bc7eSAndroid Build Coastguard WorkerAWK := @AWK@
73*1208bc7eSAndroid Build Coastguard WorkerCC_MM = @CC_MM@
74*1208bc7eSAndroid Build Coastguard WorkerLM := @LM@
75*1208bc7eSAndroid Build Coastguard WorkerINSTALL = @INSTALL@
76*1208bc7eSAndroid Build Coastguard Worker
77*1208bc7eSAndroid Build Coastguard Workerifeq (macho, $(ABI))
78*1208bc7eSAndroid Build Coastguard WorkerTEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH="$(objroot)lib"
79*1208bc7eSAndroid Build Coastguard Workerelse
80*1208bc7eSAndroid Build Coastguard Workerifeq (pecoff, $(ABI))
81*1208bc7eSAndroid Build Coastguard WorkerTEST_LIBRARY_PATH := PATH="$(PATH):$(objroot)lib"
82*1208bc7eSAndroid Build Coastguard Workerelse
83*1208bc7eSAndroid Build Coastguard WorkerTEST_LIBRARY_PATH :=
84*1208bc7eSAndroid Build Coastguard Workerendif
85*1208bc7eSAndroid Build Coastguard Workerendif
86*1208bc7eSAndroid Build Coastguard Worker
87*1208bc7eSAndroid Build Coastguard WorkerLIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix)
88*1208bc7eSAndroid Build Coastguard Worker
89*1208bc7eSAndroid Build Coastguard Worker# Lists of files.
90*1208bc7eSAndroid Build Coastguard WorkerBINS := $(objroot)bin/jemalloc-config $(objroot)bin/jemalloc.sh $(objroot)bin/jeprof
91*1208bc7eSAndroid Build Coastguard WorkerC_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h
92*1208bc7eSAndroid Build Coastguard WorkerC_SRCS := $(srcroot)src/jemalloc.c \
93*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/arena.c \
94*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/background_thread.c \
95*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/base.c \
96*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/bin.c \
97*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/bitmap.c \
98*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/ckh.c \
99*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/ctl.c \
100*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/div.c \
101*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/extent.c \
102*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/extent_dss.c \
103*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/extent_mmap.c \
104*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/hash.c \
105*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/hooks.c \
106*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/large.c \
107*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/log.c \
108*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/malloc_io.c \
109*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/mutex.c \
110*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/mutex_pool.c \
111*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/nstime.c \
112*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/pages.c \
113*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/prng.c \
114*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/prof.c \
115*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/rtree.c \
116*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/stats.c \
117*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/sz.c \
118*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/tcache.c \
119*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/ticker.c \
120*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/tsd.c \
121*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)src/witness.c
122*1208bc7eSAndroid Build Coastguard Workerifeq ($(enable_zone_allocator), 1)
123*1208bc7eSAndroid Build Coastguard WorkerC_SRCS += $(srcroot)src/zone.c
124*1208bc7eSAndroid Build Coastguard Workerendif
125*1208bc7eSAndroid Build Coastguard Workerifeq ($(IMPORTLIB),$(SO))
126*1208bc7eSAndroid Build Coastguard WorkerSTATIC_LIBS := $(objroot)lib/$(LIBJEMALLOC).$(A)
127*1208bc7eSAndroid Build Coastguard Workerendif
128*1208bc7eSAndroid Build Coastguard Workerifdef PIC_CFLAGS
129*1208bc7eSAndroid Build Coastguard WorkerSTATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_pic.$(A)
130*1208bc7eSAndroid Build Coastguard Workerelse
131*1208bc7eSAndroid Build Coastguard WorkerSTATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_s.$(A)
132*1208bc7eSAndroid Build Coastguard Workerendif
133*1208bc7eSAndroid Build Coastguard WorkerDSOS := $(objroot)lib/$(LIBJEMALLOC).$(SOREV)
134*1208bc7eSAndroid Build Coastguard Workerifneq ($(SOREV),$(SO))
135*1208bc7eSAndroid Build Coastguard WorkerDSOS += $(objroot)lib/$(LIBJEMALLOC).$(SO)
136*1208bc7eSAndroid Build Coastguard Workerendif
137*1208bc7eSAndroid Build Coastguard Workerifeq (1, $(link_whole_archive))
138*1208bc7eSAndroid Build Coastguard WorkerLJEMALLOC := -Wl,--whole-archive -L$(objroot)lib -l$(LIBJEMALLOC) -Wl,--no-whole-archive
139*1208bc7eSAndroid Build Coastguard Workerelse
140*1208bc7eSAndroid Build Coastguard WorkerLJEMALLOC := $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
141*1208bc7eSAndroid Build Coastguard Workerendif
142*1208bc7eSAndroid Build Coastguard WorkerPC := $(objroot)jemalloc.pc
143*1208bc7eSAndroid Build Coastguard WorkerMAN3 := $(objroot)doc/jemalloc$(install_suffix).3
144*1208bc7eSAndroid Build Coastguard WorkerDOCS_XML := $(objroot)doc/jemalloc$(install_suffix).xml
145*1208bc7eSAndroid Build Coastguard WorkerDOCS_HTML := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.html)
146*1208bc7eSAndroid Build Coastguard WorkerDOCS_MAN3 := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.3)
147*1208bc7eSAndroid Build Coastguard WorkerDOCS := $(DOCS_HTML) $(DOCS_MAN3)
148*1208bc7eSAndroid Build Coastguard WorkerC_TESTLIB_SRCS := $(srcroot)test/src/btalloc.c $(srcroot)test/src/btalloc_0.c \
149*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/src/btalloc_1.c $(srcroot)test/src/math.c \
150*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/src/mtx.c $(srcroot)test/src/mq.c \
151*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/src/SFMT.c $(srcroot)test/src/test.c \
152*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/src/thd.c $(srcroot)test/src/timer.c
153*1208bc7eSAndroid Build Coastguard Workerifeq (1, $(link_whole_archive))
154*1208bc7eSAndroid Build Coastguard WorkerC_UTIL_INTEGRATION_SRCS :=
155*1208bc7eSAndroid Build Coastguard WorkerC_UTIL_CPP_SRCS :=
156*1208bc7eSAndroid Build Coastguard Workerelse
157*1208bc7eSAndroid Build Coastguard WorkerC_UTIL_INTEGRATION_SRCS := $(srcroot)src/nstime.c $(srcroot)src/malloc_io.c
158*1208bc7eSAndroid Build Coastguard WorkerC_UTIL_CPP_SRCS := $(srcroot)src/nstime.c $(srcroot)src/malloc_io.c
159*1208bc7eSAndroid Build Coastguard Workerendif
160*1208bc7eSAndroid Build Coastguard WorkerTESTS_UNIT := \
161*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/a0.c \
162*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/arena_reset.c \
163*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/atomic.c \
164*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/background_thread.c \
165*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/background_thread_enable.c \
166*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/base.c \
167*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/bitmap.c \
168*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/ckh.c \
169*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/decay.c \
170*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/div.c \
171*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/emitter.c \
172*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/extent_quantize.c \
173*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/fork.c \
174*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/hash.c \
175*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/hooks.c \
176*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/junk.c \
177*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/junk_alloc.c \
178*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/junk_free.c \
179*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/log.c \
180*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/mallctl.c \
181*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/malloc_io.c \
182*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/math.c \
183*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/mq.c \
184*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/mtx.c \
185*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/pack.c \
186*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/pages.c \
187*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/ph.c \
188*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prng.c \
189*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_accum.c \
190*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_active.c \
191*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_gdump.c \
192*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_idump.c \
193*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_reset.c \
194*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_tctx.c \
195*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/prof_thread_name.c \
196*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/ql.c \
197*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/qr.c \
198*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/rb.c \
199*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/retained.c \
200*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/rtree.c \
201*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/SFMT.c \
202*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/size_classes.c \
203*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/slab.c \
204*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/smoothstep.c \
205*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/spin.c \
206*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/stats.c \
207*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/stats_print.c \
208*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/ticker.c \
209*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/nstime.c \
210*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/tsd.c \
211*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/witness.c \
212*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/zero.c
213*1208bc7eSAndroid Build Coastguard Workerifeq (@enable_prof@, 1)
214*1208bc7eSAndroid Build Coastguard WorkerTESTS_UNIT += \
215*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/unit/arena_reset_prof.c
216*1208bc7eSAndroid Build Coastguard Workerendif
217*1208bc7eSAndroid Build Coastguard WorkerTESTS_INTEGRATION := $(srcroot)test/integration/aligned_alloc.c \
218*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/allocated.c \
219*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/extent.c \
220*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/mallocx.c \
221*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/MALLOCX_ARENA.c \
222*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/overflow.c \
223*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/posix_memalign.c \
224*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/rallocx.c \
225*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/sdallocx.c \
226*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/thread_arena.c \
227*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/thread_tcache_enabled.c \
228*1208bc7eSAndroid Build Coastguard Worker	$(srcroot)test/integration/xallocx.c
229*1208bc7eSAndroid Build Coastguard Workerifeq (@enable_cxx@, 1)
230*1208bc7eSAndroid Build Coastguard WorkerCPP_SRCS := $(srcroot)src/jemalloc_cpp.cpp
231*1208bc7eSAndroid Build Coastguard WorkerTESTS_INTEGRATION_CPP := $(srcroot)test/integration/cpp/basic.cpp
232*1208bc7eSAndroid Build Coastguard Workerelse
233*1208bc7eSAndroid Build Coastguard WorkerCPP_SRCS :=
234*1208bc7eSAndroid Build Coastguard WorkerTESTS_INTEGRATION_CPP :=
235*1208bc7eSAndroid Build Coastguard Workerendif
236*1208bc7eSAndroid Build Coastguard WorkerTESTS_STRESS := $(srcroot)test/stress/microbench.c
237*1208bc7eSAndroid Build Coastguard Worker
238*1208bc7eSAndroid Build Coastguard WorkerTESTS := $(TESTS_UNIT) $(TESTS_INTEGRATION) $(TESTS_INTEGRATION_CPP) $(TESTS_STRESS)
239*1208bc7eSAndroid Build Coastguard Worker
240*1208bc7eSAndroid Build Coastguard WorkerPRIVATE_NAMESPACE_HDRS := $(objroot)include/jemalloc/internal/private_namespace.h $(objroot)include/jemalloc/internal/private_namespace_jet.h
241*1208bc7eSAndroid Build Coastguard WorkerPRIVATE_NAMESPACE_GEN_HDRS := $(PRIVATE_NAMESPACE_HDRS:%.h=%.gen.h)
242*1208bc7eSAndroid Build Coastguard WorkerC_SYM_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.sym.$(O))
243*1208bc7eSAndroid Build Coastguard WorkerC_SYMS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.sym)
244*1208bc7eSAndroid Build Coastguard WorkerC_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.$(O))
245*1208bc7eSAndroid Build Coastguard WorkerCPP_OBJS := $(CPP_SRCS:$(srcroot)%.cpp=$(objroot)%.$(O))
246*1208bc7eSAndroid Build Coastguard WorkerC_PIC_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.pic.$(O))
247*1208bc7eSAndroid Build Coastguard WorkerCPP_PIC_OBJS := $(CPP_SRCS:$(srcroot)%.cpp=$(objroot)%.pic.$(O))
248*1208bc7eSAndroid Build Coastguard WorkerC_JET_SYM_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.sym.$(O))
249*1208bc7eSAndroid Build Coastguard WorkerC_JET_SYMS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.sym)
250*1208bc7eSAndroid Build Coastguard WorkerC_JET_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.$(O))
251*1208bc7eSAndroid Build Coastguard WorkerC_TESTLIB_UNIT_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.unit.$(O))
252*1208bc7eSAndroid Build Coastguard WorkerC_TESTLIB_INTEGRATION_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O))
253*1208bc7eSAndroid Build Coastguard WorkerC_UTIL_INTEGRATION_OBJS := $(C_UTIL_INTEGRATION_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O))
254*1208bc7eSAndroid Build Coastguard WorkerC_TESTLIB_STRESS_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.stress.$(O))
255*1208bc7eSAndroid Build Coastguard WorkerC_TESTLIB_OBJS := $(C_TESTLIB_UNIT_OBJS) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(C_TESTLIB_STRESS_OBJS)
256*1208bc7eSAndroid Build Coastguard Worker
257*1208bc7eSAndroid Build Coastguard WorkerTESTS_UNIT_OBJS := $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%.$(O))
258*1208bc7eSAndroid Build Coastguard WorkerTESTS_INTEGRATION_OBJS := $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%.$(O))
259*1208bc7eSAndroid Build Coastguard WorkerTESTS_INTEGRATION_CPP_OBJS := $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%.$(O))
260*1208bc7eSAndroid Build Coastguard WorkerTESTS_STRESS_OBJS := $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%.$(O))
261*1208bc7eSAndroid Build Coastguard WorkerTESTS_OBJS := $(TESTS_UNIT_OBJS) $(TESTS_INTEGRATION_OBJS) $(TESTS_STRESS_OBJS)
262*1208bc7eSAndroid Build Coastguard WorkerTESTS_CPP_OBJS := $(TESTS_INTEGRATION_CPP_OBJS)
263*1208bc7eSAndroid Build Coastguard Worker
264*1208bc7eSAndroid Build Coastguard Worker.PHONY: all dist build_doc_html build_doc_man build_doc
265*1208bc7eSAndroid Build Coastguard Worker.PHONY: install_bin install_include install_lib
266*1208bc7eSAndroid Build Coastguard Worker.PHONY: install_doc_html install_doc_man install_doc install
267*1208bc7eSAndroid Build Coastguard Worker.PHONY: tests check clean distclean relclean
268*1208bc7eSAndroid Build Coastguard Worker
269*1208bc7eSAndroid Build Coastguard Worker.SECONDARY : $(PRIVATE_NAMESPACE_GEN_HDRS) $(TESTS_OBJS) $(TESTS_CPP_OBJS)
270*1208bc7eSAndroid Build Coastguard Worker
271*1208bc7eSAndroid Build Coastguard Worker# Default target.
272*1208bc7eSAndroid Build Coastguard Workerall: build_lib
273*1208bc7eSAndroid Build Coastguard Worker
274*1208bc7eSAndroid Build Coastguard Workerdist: build_doc
275*1208bc7eSAndroid Build Coastguard Worker
276*1208bc7eSAndroid Build Coastguard Worker$(objroot)doc/%.html : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/html.xsl
277*1208bc7eSAndroid Build Coastguard Worker	$(XSLTPROC) -o $@ $(objroot)doc/html.xsl $<
278*1208bc7eSAndroid Build Coastguard Worker
279*1208bc7eSAndroid Build Coastguard Worker$(objroot)doc/%.3 : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/manpages.xsl
280*1208bc7eSAndroid Build Coastguard Worker	$(XSLTPROC) -o $@ $(objroot)doc/manpages.xsl $<
281*1208bc7eSAndroid Build Coastguard Worker
282*1208bc7eSAndroid Build Coastguard Workerbuild_doc_html: $(DOCS_HTML)
283*1208bc7eSAndroid Build Coastguard Workerbuild_doc_man: $(DOCS_MAN3)
284*1208bc7eSAndroid Build Coastguard Workerbuild_doc: $(DOCS)
285*1208bc7eSAndroid Build Coastguard Worker
286*1208bc7eSAndroid Build Coastguard Worker#
287*1208bc7eSAndroid Build Coastguard Worker# Include generated dependency files.
288*1208bc7eSAndroid Build Coastguard Worker#
289*1208bc7eSAndroid Build Coastguard Workerifdef CC_MM
290*1208bc7eSAndroid Build Coastguard Worker-include $(C_SYM_OBJS:%.$(O)=%.d)
291*1208bc7eSAndroid Build Coastguard Worker-include $(C_OBJS:%.$(O)=%.d)
292*1208bc7eSAndroid Build Coastguard Worker-include $(CPP_OBJS:%.$(O)=%.d)
293*1208bc7eSAndroid Build Coastguard Worker-include $(C_PIC_OBJS:%.$(O)=%.d)
294*1208bc7eSAndroid Build Coastguard Worker-include $(CPP_PIC_OBJS:%.$(O)=%.d)
295*1208bc7eSAndroid Build Coastguard Worker-include $(C_JET_SYM_OBJS:%.$(O)=%.d)
296*1208bc7eSAndroid Build Coastguard Worker-include $(C_JET_OBJS:%.$(O)=%.d)
297*1208bc7eSAndroid Build Coastguard Worker-include $(C_TESTLIB_OBJS:%.$(O)=%.d)
298*1208bc7eSAndroid Build Coastguard Worker-include $(TESTS_OBJS:%.$(O)=%.d)
299*1208bc7eSAndroid Build Coastguard Worker-include $(TESTS_CPP_OBJS:%.$(O)=%.d)
300*1208bc7eSAndroid Build Coastguard Workerendif
301*1208bc7eSAndroid Build Coastguard Worker
302*1208bc7eSAndroid Build Coastguard Worker$(C_SYM_OBJS): $(objroot)src/%.sym.$(O): $(srcroot)src/%.c
303*1208bc7eSAndroid Build Coastguard Worker$(C_SYM_OBJS): CPPFLAGS += -DJEMALLOC_NO_PRIVATE_NAMESPACE
304*1208bc7eSAndroid Build Coastguard Worker$(C_SYMS): $(objroot)src/%.sym: $(objroot)src/%.sym.$(O)
305*1208bc7eSAndroid Build Coastguard Worker$(C_OBJS): $(objroot)src/%.$(O): $(srcroot)src/%.c
306*1208bc7eSAndroid Build Coastguard Worker$(CPP_OBJS): $(objroot)src/%.$(O): $(srcroot)src/%.cpp
307*1208bc7eSAndroid Build Coastguard Worker$(C_PIC_OBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.c
308*1208bc7eSAndroid Build Coastguard Worker$(C_PIC_OBJS): CFLAGS += $(PIC_CFLAGS)
309*1208bc7eSAndroid Build Coastguard Worker$(CPP_PIC_OBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.cpp
310*1208bc7eSAndroid Build Coastguard Worker$(CPP_PIC_OBJS): CXXFLAGS += $(PIC_CFLAGS)
311*1208bc7eSAndroid Build Coastguard Worker$(C_JET_SYM_OBJS): $(objroot)src/%.jet.sym.$(O): $(srcroot)src/%.c
312*1208bc7eSAndroid Build Coastguard Worker$(C_JET_SYM_OBJS): CPPFLAGS += -DJEMALLOC_JET -DJEMALLOC_NO_PRIVATE_NAMESPACE
313*1208bc7eSAndroid Build Coastguard Worker$(C_JET_SYMS): $(objroot)src/%.jet.sym: $(objroot)src/%.jet.sym.$(O)
314*1208bc7eSAndroid Build Coastguard Worker$(C_JET_OBJS): $(objroot)src/%.jet.$(O): $(srcroot)src/%.c
315*1208bc7eSAndroid Build Coastguard Worker$(C_JET_OBJS): CPPFLAGS += -DJEMALLOC_JET
316*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_UNIT_OBJS): $(objroot)test/src/%.unit.$(O): $(srcroot)test/src/%.c
317*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST
318*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_INTEGRATION_OBJS): $(objroot)test/src/%.integration.$(O): $(srcroot)test/src/%.c
319*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST
320*1208bc7eSAndroid Build Coastguard Worker$(C_UTIL_INTEGRATION_OBJS): $(objroot)src/%.integration.$(O): $(srcroot)src/%.c
321*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_STRESS_OBJS): $(objroot)test/src/%.stress.$(O): $(srcroot)test/src/%.c
322*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST -DJEMALLOC_STRESS_TESTLIB
323*1208bc7eSAndroid Build Coastguard Worker$(C_TESTLIB_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
324*1208bc7eSAndroid Build Coastguard Worker$(TESTS_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST
325*1208bc7eSAndroid Build Coastguard Worker$(TESTS_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST
326*1208bc7eSAndroid Build Coastguard Worker$(TESTS_INTEGRATION_CPP_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_CPP_TEST
327*1208bc7eSAndroid Build Coastguard Worker$(TESTS_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST
328*1208bc7eSAndroid Build Coastguard Worker$(TESTS_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.c
329*1208bc7eSAndroid Build Coastguard Worker$(TESTS_CPP_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.cpp
330*1208bc7eSAndroid Build Coastguard Worker$(TESTS_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
331*1208bc7eSAndroid Build Coastguard Worker$(TESTS_CPP_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
332*1208bc7eSAndroid Build Coastguard Workerifneq ($(IMPORTLIB),$(SO))
333*1208bc7eSAndroid Build Coastguard Worker$(CPP_OBJS) $(C_SYM_OBJS) $(C_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS): CPPFLAGS += -DDLLEXPORT
334*1208bc7eSAndroid Build Coastguard Workerendif
335*1208bc7eSAndroid Build Coastguard Worker
336*1208bc7eSAndroid Build Coastguard Worker# Dependencies.
337*1208bc7eSAndroid Build Coastguard Workerifndef CC_MM
338*1208bc7eSAndroid Build Coastguard WorkerHEADER_DIRS = $(srcroot)include/jemalloc/internal \
339*1208bc7eSAndroid Build Coastguard Worker	$(objroot)include/jemalloc $(objroot)include/jemalloc/internal
340*1208bc7eSAndroid Build Coastguard WorkerHEADERS = $(filter-out $(PRIVATE_NAMESPACE_HDRS),$(wildcard $(foreach dir,$(HEADER_DIRS),$(dir)/*.h)))
341*1208bc7eSAndroid Build Coastguard Worker$(C_SYM_OBJS) $(C_OBJS) $(CPP_OBJS) $(C_PIC_OBJS) $(CPP_PIC_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS) $(TESTS_CPP_OBJS): $(HEADERS)
342*1208bc7eSAndroid Build Coastguard Worker$(TESTS_OBJS) $(TESTS_CPP_OBJS): $(objroot)test/include/test/jemalloc_test.h
343*1208bc7eSAndroid Build Coastguard Workerendif
344*1208bc7eSAndroid Build Coastguard Worker
345*1208bc7eSAndroid Build Coastguard Worker$(C_OBJS) $(CPP_OBJS) $(C_PIC_OBJS) $(CPP_PIC_OBJS) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(TESTS_INTEGRATION_OBJS) $(TESTS_INTEGRATION_CPP_OBJS): $(objroot)include/jemalloc/internal/private_namespace.h
346*1208bc7eSAndroid Build Coastguard Worker$(C_JET_OBJS) $(C_TESTLIB_UNIT_OBJS) $(C_TESTLIB_STRESS_OBJS) $(TESTS_UNIT_OBJS) $(TESTS_STRESS_OBJS): $(objroot)include/jemalloc/internal/private_namespace_jet.h
347*1208bc7eSAndroid Build Coastguard Worker
348*1208bc7eSAndroid Build Coastguard Worker$(C_SYM_OBJS) $(C_OBJS) $(C_PIC_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS): %.$(O):
349*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
350*1208bc7eSAndroid Build Coastguard Worker	$(CC) $(CFLAGS) -c $(CPPFLAGS) $(CTARGET) $<
351*1208bc7eSAndroid Build Coastguard Workerifdef CC_MM
352*1208bc7eSAndroid Build Coastguard Worker	@$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $<
353*1208bc7eSAndroid Build Coastguard Workerendif
354*1208bc7eSAndroid Build Coastguard Worker
355*1208bc7eSAndroid Build Coastguard Worker$(C_SYMS): %.sym:
356*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
357*1208bc7eSAndroid Build Coastguard Worker	$(DUMP_SYMS) $< | $(AWK) -f $(objroot)include/jemalloc/internal/private_symbols.awk > $@
358*1208bc7eSAndroid Build Coastguard Worker
359*1208bc7eSAndroid Build Coastguard Worker$(C_JET_SYMS): %.sym:
360*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
361*1208bc7eSAndroid Build Coastguard Worker	$(DUMP_SYMS) $< | $(AWK) -f $(objroot)include/jemalloc/internal/private_symbols_jet.awk > $@
362*1208bc7eSAndroid Build Coastguard Worker
363*1208bc7eSAndroid Build Coastguard Worker$(objroot)include/jemalloc/internal/private_namespace.gen.h: $(C_SYMS)
364*1208bc7eSAndroid Build Coastguard Worker	$(SHELL) $(srcroot)include/jemalloc/internal/private_namespace.sh $^ > $@
365*1208bc7eSAndroid Build Coastguard Worker
366*1208bc7eSAndroid Build Coastguard Worker$(objroot)include/jemalloc/internal/private_namespace_jet.gen.h: $(C_JET_SYMS)
367*1208bc7eSAndroid Build Coastguard Worker	$(SHELL) $(srcroot)include/jemalloc/internal/private_namespace.sh $^ > $@
368*1208bc7eSAndroid Build Coastguard Worker
369*1208bc7eSAndroid Build Coastguard Worker%.h: %.gen.h
370*1208bc7eSAndroid Build Coastguard Worker	@if ! `cmp -s $< $@` ; then echo "cp $< $<"; cp $< $@ ; fi
371*1208bc7eSAndroid Build Coastguard Worker
372*1208bc7eSAndroid Build Coastguard Worker$(CPP_OBJS) $(CPP_PIC_OBJS) $(TESTS_CPP_OBJS): %.$(O):
373*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
374*1208bc7eSAndroid Build Coastguard Worker	$(CXX) $(CXXFLAGS) -c $(CPPFLAGS) $(CTARGET) $<
375*1208bc7eSAndroid Build Coastguard Workerifdef CC_MM
376*1208bc7eSAndroid Build Coastguard Worker	@$(CXX) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $<
377*1208bc7eSAndroid Build Coastguard Workerendif
378*1208bc7eSAndroid Build Coastguard Worker
379*1208bc7eSAndroid Build Coastguard Workerifneq ($(SOREV),$(SO))
380*1208bc7eSAndroid Build Coastguard Worker%.$(SO) : %.$(SOREV)
381*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
382*1208bc7eSAndroid Build Coastguard Worker	ln -sf $(<F) $@
383*1208bc7eSAndroid Build Coastguard Workerendif
384*1208bc7eSAndroid Build Coastguard Worker
385*1208bc7eSAndroid Build Coastguard Worker$(objroot)lib/$(LIBJEMALLOC).$(SOREV) : $(if $(PIC_CFLAGS),$(C_PIC_OBJS),$(C_OBJS)) $(if $(PIC_CFLAGS),$(CPP_PIC_OBJS),$(CPP_OBJS))
386*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
387*1208bc7eSAndroid Build Coastguard Worker	$(CC) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS)
388*1208bc7eSAndroid Build Coastguard Worker
389*1208bc7eSAndroid Build Coastguard Worker$(objroot)lib/$(LIBJEMALLOC)_pic.$(A) : $(C_PIC_OBJS) $(CPP_PIC_OBJS)
390*1208bc7eSAndroid Build Coastguard Worker$(objroot)lib/$(LIBJEMALLOC).$(A) : $(C_OBJS) $(CPP_OBJS)
391*1208bc7eSAndroid Build Coastguard Worker$(objroot)lib/$(LIBJEMALLOC)_s.$(A) : $(C_OBJS) $(CPP_OBJS)
392*1208bc7eSAndroid Build Coastguard Worker
393*1208bc7eSAndroid Build Coastguard Worker$(STATIC_LIBS):
394*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
395*1208bc7eSAndroid Build Coastguard Worker	$(AR) $(ARFLAGS)@AROUT@ $+
396*1208bc7eSAndroid Build Coastguard Worker
397*1208bc7eSAndroid Build Coastguard Worker$(objroot)test/unit/%$(EXE): $(objroot)test/unit/%.$(O) $(C_JET_OBJS) $(C_TESTLIB_UNIT_OBJS)
398*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
399*1208bc7eSAndroid Build Coastguard Worker	$(CC) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(LDFLAGS) $(filter-out -lm,$(LIBS)) $(LM) $(EXTRA_LDFLAGS)
400*1208bc7eSAndroid Build Coastguard Worker
401*1208bc7eSAndroid Build Coastguard Worker$(objroot)test/integration/%$(EXE): $(objroot)test/integration/%.$(O) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
402*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
403*1208bc7eSAndroid Build Coastguard Worker	$(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(LJEMALLOC) $(LDFLAGS) $(filter-out -lm,$(filter -lrt -lpthread -lstdc++,$(LIBS))) $(LM) $(EXTRA_LDFLAGS)
404*1208bc7eSAndroid Build Coastguard Worker
405*1208bc7eSAndroid Build Coastguard Worker$(objroot)test/integration/cpp/%$(EXE): $(objroot)test/integration/cpp/%.$(O) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
406*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
407*1208bc7eSAndroid Build Coastguard Worker	$(CXX) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB) $(LDFLAGS) $(filter-out -lm,$(LIBS)) -lm $(EXTRA_LDFLAGS)
408*1208bc7eSAndroid Build Coastguard Worker
409*1208bc7eSAndroid Build Coastguard Worker$(objroot)test/stress/%$(EXE): $(objroot)test/stress/%.$(O) $(C_JET_OBJS) $(C_TESTLIB_STRESS_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
410*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(@D)
411*1208bc7eSAndroid Build Coastguard Worker	$(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB) $(LDFLAGS) $(filter-out -lm,$(LIBS)) $(LM) $(EXTRA_LDFLAGS)
412*1208bc7eSAndroid Build Coastguard Worker
413*1208bc7eSAndroid Build Coastguard Workerbuild_lib_shared: $(DSOS)
414*1208bc7eSAndroid Build Coastguard Workerbuild_lib_static: $(STATIC_LIBS)
415*1208bc7eSAndroid Build Coastguard Workerbuild_lib: build_lib_shared build_lib_static
416*1208bc7eSAndroid Build Coastguard Worker
417*1208bc7eSAndroid Build Coastguard Workerinstall_bin:
418*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(BINDIR)
419*1208bc7eSAndroid Build Coastguard Worker	@for b in $(BINS); do \
420*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 755 $$b $(BINDIR)"; \
421*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 755 $$b $(BINDIR); \
422*1208bc7eSAndroid Build Coastguard Workerdone
423*1208bc7eSAndroid Build Coastguard Worker
424*1208bc7eSAndroid Build Coastguard Workerinstall_include:
425*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(INCLUDEDIR)/jemalloc
426*1208bc7eSAndroid Build Coastguard Worker	@for h in $(C_HDRS); do \
427*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 644 $$h $(INCLUDEDIR)/jemalloc"; \
428*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 644 $$h $(INCLUDEDIR)/jemalloc; \
429*1208bc7eSAndroid Build Coastguard Workerdone
430*1208bc7eSAndroid Build Coastguard Worker
431*1208bc7eSAndroid Build Coastguard Workerinstall_lib_shared: $(DSOS)
432*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(LIBDIR)
433*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)
434*1208bc7eSAndroid Build Coastguard Workerifneq ($(SOREV),$(SO))
435*1208bc7eSAndroid Build Coastguard Worker	ln -sf $(LIBJEMALLOC).$(SOREV) $(LIBDIR)/$(LIBJEMALLOC).$(SO)
436*1208bc7eSAndroid Build Coastguard Workerendif
437*1208bc7eSAndroid Build Coastguard Worker
438*1208bc7eSAndroid Build Coastguard Workerinstall_lib_static: $(STATIC_LIBS)
439*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(LIBDIR)
440*1208bc7eSAndroid Build Coastguard Worker	@for l in $(STATIC_LIBS); do \
441*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 755 $$l $(LIBDIR)"; \
442*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 755 $$l $(LIBDIR); \
443*1208bc7eSAndroid Build Coastguard Workerdone
444*1208bc7eSAndroid Build Coastguard Worker
445*1208bc7eSAndroid Build Coastguard Workerinstall_lib_pc: $(PC)
446*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(LIBDIR)/pkgconfig
447*1208bc7eSAndroid Build Coastguard Worker	@for l in $(PC); do \
448*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 644 $$l $(LIBDIR)/pkgconfig"; \
449*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 644 $$l $(LIBDIR)/pkgconfig; \
450*1208bc7eSAndroid Build Coastguard Workerdone
451*1208bc7eSAndroid Build Coastguard Worker
452*1208bc7eSAndroid Build Coastguard Workerinstall_lib: install_lib_shared install_lib_static install_lib_pc
453*1208bc7eSAndroid Build Coastguard Worker
454*1208bc7eSAndroid Build Coastguard Workerinstall_doc_html:
455*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(DATADIR)/doc/jemalloc$(install_suffix)
456*1208bc7eSAndroid Build Coastguard Worker	@for d in $(DOCS_HTML); do \
457*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix)"; \
458*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix); \
459*1208bc7eSAndroid Build Coastguard Workerdone
460*1208bc7eSAndroid Build Coastguard Worker
461*1208bc7eSAndroid Build Coastguard Workerinstall_doc_man:
462*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -d $(MANDIR)/man3
463*1208bc7eSAndroid Build Coastguard Worker	@for d in $(DOCS_MAN3); do \
464*1208bc7eSAndroid Build Coastguard Worker	echo "$(INSTALL) -m 644 $$d $(MANDIR)/man3"; \
465*1208bc7eSAndroid Build Coastguard Worker	$(INSTALL) -m 644 $$d $(MANDIR)/man3; \
466*1208bc7eSAndroid Build Coastguard Workerdone
467*1208bc7eSAndroid Build Coastguard Worker
468*1208bc7eSAndroid Build Coastguard Workerinstall_doc: install_doc_html install_doc_man
469*1208bc7eSAndroid Build Coastguard Worker
470*1208bc7eSAndroid Build Coastguard Workerinstall: install_bin install_include install_lib install_doc
471*1208bc7eSAndroid Build Coastguard Worker
472*1208bc7eSAndroid Build Coastguard Workertests_unit: $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%$(EXE))
473*1208bc7eSAndroid Build Coastguard Workertests_integration: $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%$(EXE)) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%$(EXE))
474*1208bc7eSAndroid Build Coastguard Workertests_stress: $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%$(EXE))
475*1208bc7eSAndroid Build Coastguard Workertests: tests_unit tests_integration tests_stress
476*1208bc7eSAndroid Build Coastguard Worker
477*1208bc7eSAndroid Build Coastguard Workercheck_unit_dir:
478*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(objroot)test/unit
479*1208bc7eSAndroid Build Coastguard Workercheck_integration_dir:
480*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(objroot)test/integration
481*1208bc7eSAndroid Build Coastguard Workerstress_dir:
482*1208bc7eSAndroid Build Coastguard Worker	@mkdir -p $(objroot)test/stress
483*1208bc7eSAndroid Build Coastguard Workercheck_dir: check_unit_dir check_integration_dir
484*1208bc7eSAndroid Build Coastguard Worker
485*1208bc7eSAndroid Build Coastguard Workercheck_unit: tests_unit check_unit_dir
486*1208bc7eSAndroid Build Coastguard Worker	$(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%)
487*1208bc7eSAndroid Build Coastguard Workercheck_integration_prof: tests_integration check_integration_dir
488*1208bc7eSAndroid Build Coastguard Workerifeq ($(enable_prof), 1)
489*1208bc7eSAndroid Build Coastguard Worker	$(MALLOC_CONF)="prof:true" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%)
490*1208bc7eSAndroid Build Coastguard Worker	$(MALLOC_CONF)="prof:true,prof_active:false" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%)
491*1208bc7eSAndroid Build Coastguard Workerendif
492*1208bc7eSAndroid Build Coastguard Workercheck_integration_decay: tests_integration check_integration_dir
493*1208bc7eSAndroid Build Coastguard Worker	$(MALLOC_CONF)="dirty_decay_ms:-1,muzzy_decay_ms:-1" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%)
494*1208bc7eSAndroid Build Coastguard Worker	$(MALLOC_CONF)="dirty_decay_ms:0,muzzy_decay_ms:0" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%)
495*1208bc7eSAndroid Build Coastguard Workercheck_integration: tests_integration check_integration_dir
496*1208bc7eSAndroid Build Coastguard Worker	$(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%)
497*1208bc7eSAndroid Build Coastguard Workerstress: tests_stress stress_dir
498*1208bc7eSAndroid Build Coastguard Worker	$(SHELL) $(objroot)test/test.sh $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%)
499*1208bc7eSAndroid Build Coastguard Workercheck: check_unit check_integration check_integration_decay check_integration_prof
500*1208bc7eSAndroid Build Coastguard Worker
501*1208bc7eSAndroid Build Coastguard Workerclean:
502*1208bc7eSAndroid Build Coastguard Worker	rm -f $(PRIVATE_NAMESPACE_HDRS)
503*1208bc7eSAndroid Build Coastguard Worker	rm -f $(PRIVATE_NAMESPACE_GEN_HDRS)
504*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_SYM_OBJS)
505*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_SYMS)
506*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_OBJS)
507*1208bc7eSAndroid Build Coastguard Worker	rm -f $(CPP_OBJS)
508*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_PIC_OBJS)
509*1208bc7eSAndroid Build Coastguard Worker	rm -f $(CPP_PIC_OBJS)
510*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_JET_SYM_OBJS)
511*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_JET_SYMS)
512*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_JET_OBJS)
513*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_TESTLIB_OBJS)
514*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_SYM_OBJS:%.$(O)=%.d)
515*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_OBJS:%.$(O)=%.d)
516*1208bc7eSAndroid Build Coastguard Worker	rm -f $(CPP_OBJS:%.$(O)=%.d)
517*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_PIC_OBJS:%.$(O)=%.d)
518*1208bc7eSAndroid Build Coastguard Worker	rm -f $(CPP_PIC_OBJS:%.$(O)=%.d)
519*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_JET_SYM_OBJS:%.$(O)=%.d)
520*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_JET_OBJS:%.$(O)=%.d)
521*1208bc7eSAndroid Build Coastguard Worker	rm -f $(C_TESTLIB_OBJS:%.$(O)=%.d)
522*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_OBJS:%.$(O)=%$(EXE))
523*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_OBJS)
524*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_OBJS:%.$(O)=%.d)
525*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_OBJS:%.$(O)=%.out)
526*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_CPP_OBJS:%.$(O)=%$(EXE))
527*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_CPP_OBJS)
528*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_CPP_OBJS:%.$(O)=%.d)
529*1208bc7eSAndroid Build Coastguard Worker	rm -f $(TESTS_CPP_OBJS:%.$(O)=%.out)
530*1208bc7eSAndroid Build Coastguard Worker	rm -f $(DSOS) $(STATIC_LIBS)
531*1208bc7eSAndroid Build Coastguard Worker
532*1208bc7eSAndroid Build Coastguard Workerdistclean: clean
533*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)bin/jemalloc-config
534*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)bin/jemalloc.sh
535*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)bin/jeprof
536*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)config.log
537*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)config.status
538*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)config.stamp
539*1208bc7eSAndroid Build Coastguard Worker	rm -f $(cfghdrs_out)
540*1208bc7eSAndroid Build Coastguard Worker	rm -f $(cfgoutputs_out)
541*1208bc7eSAndroid Build Coastguard Worker
542*1208bc7eSAndroid Build Coastguard Workerrelclean: distclean
543*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)configure
544*1208bc7eSAndroid Build Coastguard Worker	rm -f $(objroot)VERSION
545*1208bc7eSAndroid Build Coastguard Worker	rm -f $(DOCS_HTML)
546*1208bc7eSAndroid Build Coastguard Worker	rm -f $(DOCS_MAN3)
547*1208bc7eSAndroid Build Coastguard Worker
548*1208bc7eSAndroid Build Coastguard Worker#===============================================================================
549*1208bc7eSAndroid Build Coastguard Worker# Re-configuration rules.
550*1208bc7eSAndroid Build Coastguard Worker
551*1208bc7eSAndroid Build Coastguard Workerifeq ($(enable_autogen), 1)
552*1208bc7eSAndroid Build Coastguard Worker$(srcroot)configure : $(srcroot)configure.ac
553*1208bc7eSAndroid Build Coastguard Worker	cd ./$(srcroot) && $(AUTOCONF)
554*1208bc7eSAndroid Build Coastguard Worker
555*1208bc7eSAndroid Build Coastguard Worker$(objroot)config.status : $(srcroot)configure
556*1208bc7eSAndroid Build Coastguard Worker	./$(objroot)config.status --recheck
557*1208bc7eSAndroid Build Coastguard Worker
558*1208bc7eSAndroid Build Coastguard Worker$(srcroot)config.stamp.in : $(srcroot)configure.ac
559*1208bc7eSAndroid Build Coastguard Worker	echo stamp > $(srcroot)config.stamp.in
560*1208bc7eSAndroid Build Coastguard Worker
561*1208bc7eSAndroid Build Coastguard Worker$(objroot)config.stamp : $(cfgoutputs_in) $(cfghdrs_in) $(srcroot)configure
562*1208bc7eSAndroid Build Coastguard Worker	./$(objroot)config.status
563*1208bc7eSAndroid Build Coastguard Worker	@touch $@
564*1208bc7eSAndroid Build Coastguard Worker
565*1208bc7eSAndroid Build Coastguard Worker# There must be some action in order for make to re-read Makefile when it is
566*1208bc7eSAndroid Build Coastguard Worker# out of date.
567*1208bc7eSAndroid Build Coastguard Worker$(cfgoutputs_out) $(cfghdrs_out) : $(objroot)config.stamp
568*1208bc7eSAndroid Build Coastguard Worker	@true
569*1208bc7eSAndroid Build Coastguard Workerendif
570