xref: /redis-3.2.3/deps/jemalloc/Makefile.in (revision 5268379e)
1# Clear out all vpaths, then set just one (default vpath) for the main build
2# directory.
3vpath
4vpath % .
5
6# Clear the default suffixes, so that built-in rules are not used.
7.SUFFIXES :
8
9SHELL := /bin/sh
10
11CC := @CC@
12
13# Configuration parameters.
14DESTDIR =
15BINDIR := $(DESTDIR)@BINDIR@
16INCLUDEDIR := $(DESTDIR)@INCLUDEDIR@
17LIBDIR := $(DESTDIR)@LIBDIR@
18DATADIR := $(DESTDIR)@DATADIR@
19MANDIR := $(DESTDIR)@MANDIR@
20srcroot := @srcroot@
21objroot := @objroot@
22abs_srcroot := @abs_srcroot@
23abs_objroot := @abs_objroot@
24
25# Build parameters.
26CPPFLAGS := @CPPFLAGS@ -I$(srcroot)include -I$(objroot)include
27CFLAGS := @CFLAGS@
28LDFLAGS := @LDFLAGS@
29EXTRA_LDFLAGS := @EXTRA_LDFLAGS@
30LIBS := @LIBS@
31TESTLIBS := @TESTLIBS@
32RPATH_EXTRA := @RPATH_EXTRA@
33SO := @so@
34IMPORTLIB := @importlib@
35O := @o@
36A := @a@
37EXE := @exe@
38LIBPREFIX := @libprefix@
39REV := @rev@
40install_suffix := @install_suffix@
41ABI := @abi@
42XSLTPROC := @XSLTPROC@
43AUTOCONF := @AUTOCONF@
44_RPATH = @RPATH@
45RPATH = $(if $(1),$(call _RPATH,$(1)))
46cfghdrs_in := $(addprefix $(srcroot),@cfghdrs_in@)
47cfghdrs_out := @cfghdrs_out@
48cfgoutputs_in := $(addprefix $(srcroot),@cfgoutputs_in@)
49cfgoutputs_out := @cfgoutputs_out@
50enable_autogen := @enable_autogen@
51enable_code_coverage := @enable_code_coverage@
52enable_prof := @enable_prof@
53enable_valgrind := @enable_valgrind@
54enable_zone_allocator := @enable_zone_allocator@
55MALLOC_CONF := @JEMALLOC_CPREFIX@MALLOC_CONF
56DSO_LDFLAGS = @DSO_LDFLAGS@
57SOREV = @SOREV@
58PIC_CFLAGS = @PIC_CFLAGS@
59CTARGET = @CTARGET@
60LDTARGET = @LDTARGET@
61MKLIB = @MKLIB@
62AR = @AR@
63ARFLAGS = @ARFLAGS@
64CC_MM = @CC_MM@
65
66ifeq (macho, $(ABI))
67TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH="$(objroot)lib"
68else
69ifeq (pecoff, $(ABI))
70TEST_LIBRARY_PATH := PATH="$(PATH):$(objroot)lib"
71else
72TEST_LIBRARY_PATH :=
73endif
74endif
75
76LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix)
77
78# Lists of files.
79BINS := $(objroot)bin/jemalloc-config $(objroot)bin/jemalloc.sh $(objroot)bin/jeprof
80C_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h
81C_SRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c \
82	$(srcroot)src/atomic.c $(srcroot)src/base.c $(srcroot)src/bitmap.c \
83	$(srcroot)src/chunk.c $(srcroot)src/chunk_dss.c \
84	$(srcroot)src/chunk_mmap.c $(srcroot)src/ckh.c $(srcroot)src/ctl.c \
85	$(srcroot)src/extent.c $(srcroot)src/hash.c $(srcroot)src/huge.c \
86	$(srcroot)src/mb.c $(srcroot)src/mutex.c $(srcroot)src/pages.c \
87	$(srcroot)src/prof.c $(srcroot)src/quarantine.c $(srcroot)src/rtree.c \
88	$(srcroot)src/stats.c $(srcroot)src/tcache.c $(srcroot)src/util.c \
89	$(srcroot)src/tsd.c
90ifeq ($(enable_valgrind), 1)
91C_SRCS += $(srcroot)src/valgrind.c
92endif
93ifeq ($(enable_zone_allocator), 1)
94C_SRCS += $(srcroot)src/zone.c
95endif
96ifeq ($(IMPORTLIB),$(SO))
97STATIC_LIBS := $(objroot)lib/$(LIBJEMALLOC).$(A)
98endif
99ifdef PIC_CFLAGS
100STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_pic.$(A)
101else
102STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_s.$(A)
103endif
104DSOS := $(objroot)lib/$(LIBJEMALLOC).$(SOREV)
105ifneq ($(SOREV),$(SO))
106DSOS += $(objroot)lib/$(LIBJEMALLOC).$(SO)
107endif
108PC := $(objroot)jemalloc.pc
109MAN3 := $(objroot)doc/jemalloc$(install_suffix).3
110DOCS_XML := $(objroot)doc/jemalloc$(install_suffix).xml
111DOCS_HTML := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.html)
112DOCS_MAN3 := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.3)
113DOCS := $(DOCS_HTML) $(DOCS_MAN3)
114C_TESTLIB_SRCS := $(srcroot)test/src/btalloc.c $(srcroot)test/src/btalloc_0.c \
115	$(srcroot)test/src/btalloc_1.c $(srcroot)test/src/math.c \
116	$(srcroot)test/src/mtx.c $(srcroot)test/src/mq.c \
117	$(srcroot)test/src/SFMT.c $(srcroot)test/src/test.c \
118	$(srcroot)test/src/thd.c $(srcroot)test/src/timer.c
119C_UTIL_INTEGRATION_SRCS := $(srcroot)src/util.c
120TESTS_UNIT := $(srcroot)test/unit/atomic.c \
121	$(srcroot)test/unit/bitmap.c \
122	$(srcroot)test/unit/ckh.c \
123	$(srcroot)test/unit/hash.c \
124	$(srcroot)test/unit/junk.c \
125	$(srcroot)test/unit/junk_alloc.c \
126	$(srcroot)test/unit/junk_free.c \
127	$(srcroot)test/unit/lg_chunk.c \
128	$(srcroot)test/unit/mallctl.c \
129	$(srcroot)test/unit/math.c \
130	$(srcroot)test/unit/mq.c \
131	$(srcroot)test/unit/mtx.c \
132	$(srcroot)test/unit/prof_accum.c \
133	$(srcroot)test/unit/prof_active.c \
134	$(srcroot)test/unit/prof_gdump.c \
135	$(srcroot)test/unit/prof_idump.c \
136	$(srcroot)test/unit/prof_reset.c \
137	$(srcroot)test/unit/prof_thread_name.c \
138	$(srcroot)test/unit/ql.c \
139	$(srcroot)test/unit/qr.c \
140	$(srcroot)test/unit/quarantine.c \
141	$(srcroot)test/unit/rb.c \
142	$(srcroot)test/unit/rtree.c \
143	$(srcroot)test/unit/SFMT.c \
144	$(srcroot)test/unit/size_classes.c \
145	$(srcroot)test/unit/stats.c \
146	$(srcroot)test/unit/tsd.c \
147	$(srcroot)test/unit/util.c \
148	$(srcroot)test/unit/zero.c
149TESTS_INTEGRATION := $(srcroot)test/integration/aligned_alloc.c \
150	$(srcroot)test/integration/allocated.c \
151	$(srcroot)test/integration/sdallocx.c \
152	$(srcroot)test/integration/mallocx.c \
153	$(srcroot)test/integration/MALLOCX_ARENA.c \
154	$(srcroot)test/integration/overflow.c \
155	$(srcroot)test/integration/posix_memalign.c \
156	$(srcroot)test/integration/rallocx.c \
157	$(srcroot)test/integration/thread_arena.c \
158	$(srcroot)test/integration/thread_tcache_enabled.c \
159	$(srcroot)test/integration/xallocx.c \
160	$(srcroot)test/integration/chunk.c
161TESTS_STRESS := $(srcroot)test/stress/microbench.c
162TESTS := $(TESTS_UNIT) $(TESTS_INTEGRATION) $(TESTS_STRESS)
163
164C_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.$(O))
165C_PIC_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.pic.$(O))
166C_JET_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.$(O))
167C_TESTLIB_UNIT_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.unit.$(O))
168C_TESTLIB_INTEGRATION_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O))
169C_UTIL_INTEGRATION_OBJS := $(C_UTIL_INTEGRATION_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O))
170C_TESTLIB_STRESS_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.stress.$(O))
171C_TESTLIB_OBJS := $(C_TESTLIB_UNIT_OBJS) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(C_TESTLIB_STRESS_OBJS)
172
173TESTS_UNIT_OBJS := $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%.$(O))
174TESTS_INTEGRATION_OBJS := $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%.$(O))
175TESTS_STRESS_OBJS := $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%.$(O))
176TESTS_OBJS := $(TESTS_UNIT_OBJS) $(TESTS_INTEGRATION_OBJS) $(TESTS_STRESS_OBJS)
177
178.PHONY: all dist build_doc_html build_doc_man build_doc
179.PHONY: install_bin install_include install_lib
180.PHONY: install_doc_html install_doc_man install_doc install
181.PHONY: tests check clean distclean relclean
182
183.SECONDARY : $(TESTS_OBJS)
184
185# Default target.
186all: build_lib
187
188dist: build_doc
189
190$(objroot)doc/%.html : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/html.xsl
191	$(XSLTPROC) -o $@ $(objroot)doc/html.xsl $<
192
193$(objroot)doc/%.3 : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/manpages.xsl
194	$(XSLTPROC) -o $@ $(objroot)doc/manpages.xsl $<
195
196build_doc_html: $(DOCS_HTML)
197build_doc_man: $(DOCS_MAN3)
198build_doc: $(DOCS)
199
200#
201# Include generated dependency files.
202#
203ifdef CC_MM
204-include $(C_OBJS:%.$(O)=%.d)
205-include $(C_PIC_OBJS:%.$(O)=%.d)
206-include $(C_JET_OBJS:%.$(O)=%.d)
207-include $(C_TESTLIB_OBJS:%.$(O)=%.d)
208-include $(TESTS_OBJS:%.$(O)=%.d)
209endif
210
211$(C_OBJS): $(objroot)src/%.$(O): $(srcroot)src/%.c
212$(C_PIC_OBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.c
213$(C_PIC_OBJS): CFLAGS += $(PIC_CFLAGS)
214$(C_JET_OBJS): $(objroot)src/%.jet.$(O): $(srcroot)src/%.c
215$(C_JET_OBJS): CFLAGS += -DJEMALLOC_JET
216$(C_TESTLIB_UNIT_OBJS): $(objroot)test/src/%.unit.$(O): $(srcroot)test/src/%.c
217$(C_TESTLIB_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST
218$(C_TESTLIB_INTEGRATION_OBJS): $(objroot)test/src/%.integration.$(O): $(srcroot)test/src/%.c
219$(C_TESTLIB_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST
220$(C_UTIL_INTEGRATION_OBJS): $(objroot)src/%.integration.$(O): $(srcroot)src/%.c
221$(C_TESTLIB_STRESS_OBJS): $(objroot)test/src/%.stress.$(O): $(srcroot)test/src/%.c
222$(C_TESTLIB_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST -DJEMALLOC_STRESS_TESTLIB
223$(C_TESTLIB_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
224$(TESTS_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST
225$(TESTS_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST
226$(TESTS_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST
227$(TESTS_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.c
228$(TESTS_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
229ifneq ($(IMPORTLIB),$(SO))
230$(C_OBJS) $(C_JET_OBJS): CPPFLAGS += -DDLLEXPORT
231endif
232
233ifndef CC_MM
234# Dependencies.
235HEADER_DIRS = $(srcroot)include/jemalloc/internal \
236	$(objroot)include/jemalloc $(objroot)include/jemalloc/internal
237HEADERS = $(wildcard $(foreach dir,$(HEADER_DIRS),$(dir)/*.h))
238$(C_OBJS) $(C_PIC_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS): $(HEADERS)
239$(TESTS_OBJS): $(objroot)test/include/test/jemalloc_test.h
240endif
241
242$(C_OBJS) $(C_PIC_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS): %.$(O):
243	@mkdir -p $(@D)
244	$(CC) $(CFLAGS) -c $(CPPFLAGS) $(CTARGET) $<
245ifdef CC_MM
246	@$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $<
247endif
248
249ifneq ($(SOREV),$(SO))
250%.$(SO) : %.$(SOREV)
251	@mkdir -p $(@D)
252	ln -sf $(<F) $@
253endif
254
255$(objroot)lib/$(LIBJEMALLOC).$(SOREV) : $(if $(PIC_CFLAGS),$(C_PIC_OBJS),$(C_OBJS))
256	@mkdir -p $(@D)
257	$(CC) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS)
258
259$(objroot)lib/$(LIBJEMALLOC)_pic.$(A) : $(C_PIC_OBJS)
260$(objroot)lib/$(LIBJEMALLOC).$(A) : $(C_OBJS)
261$(objroot)lib/$(LIBJEMALLOC)_s.$(A) : $(C_OBJS)
262
263$(STATIC_LIBS):
264	@mkdir -p $(@D)
265	$(AR) $(ARFLAGS)@AROUT@ $+
266
267$(objroot)test/unit/%$(EXE): $(objroot)test/unit/%.$(O) $(TESTS_UNIT_LINK_OBJS) $(C_JET_OBJS) $(C_TESTLIB_UNIT_OBJS)
268	@mkdir -p $(@D)
269	$(CC) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(LDFLAGS) $(filter-out -lm,$(LIBS)) -lm $(TESTLIBS) $(EXTRA_LDFLAGS)
270
271$(objroot)test/integration/%$(EXE): $(objroot)test/integration/%.$(O) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
272	@mkdir -p $(@D)
273	$(CC) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB) $(LDFLAGS) $(filter-out -lm,$(filter -lpthread,$(LIBS))) -lm $(TESTLIBS) $(EXTRA_LDFLAGS)
274
275$(objroot)test/stress/%$(EXE): $(objroot)test/stress/%.$(O) $(C_JET_OBJS) $(C_TESTLIB_STRESS_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
276	@mkdir -p $(@D)
277	$(CC) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB) $(LDFLAGS) $(filter-out -lm,$(LIBS)) -lm $(TESTLIBS) $(EXTRA_LDFLAGS)
278
279build_lib_shared: $(DSOS)
280build_lib_static: $(STATIC_LIBS)
281build_lib: build_lib_shared build_lib_static
282
283install_bin:
284	install -d $(BINDIR)
285	@for b in $(BINS); do \
286	echo "install -m 755 $$b $(BINDIR)"; \
287	install -m 755 $$b $(BINDIR); \
288done
289
290install_include:
291	install -d $(INCLUDEDIR)/jemalloc
292	@for h in $(C_HDRS); do \
293	echo "install -m 644 $$h $(INCLUDEDIR)/jemalloc"; \
294	install -m 644 $$h $(INCLUDEDIR)/jemalloc; \
295done
296
297install_lib_shared: $(DSOS)
298	install -d $(LIBDIR)
299	install -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)
300ifneq ($(SOREV),$(SO))
301	ln -sf $(LIBJEMALLOC).$(SOREV) $(LIBDIR)/$(LIBJEMALLOC).$(SO)
302endif
303
304install_lib_static: $(STATIC_LIBS)
305	install -d $(LIBDIR)
306	@for l in $(STATIC_LIBS); do \
307	echo "install -m 755 $$l $(LIBDIR)"; \
308	install -m 755 $$l $(LIBDIR); \
309done
310
311install_lib_pc: $(PC)
312	install -d $(LIBDIR)/pkgconfig
313	@for l in $(PC); do \
314	echo "install -m 644 $$l $(LIBDIR)/pkgconfig"; \
315	install -m 644 $$l $(LIBDIR)/pkgconfig; \
316done
317
318install_lib: install_lib_shared install_lib_static install_lib_pc
319
320install_doc_html:
321	install -d $(DATADIR)/doc/jemalloc$(install_suffix)
322	@for d in $(DOCS_HTML); do \
323	echo "install -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix)"; \
324	install -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix); \
325done
326
327install_doc_man:
328	install -d $(MANDIR)/man3
329	@for d in $(DOCS_MAN3); do \
330	echo "install -m 644 $$d $(MANDIR)/man3"; \
331	install -m 644 $$d $(MANDIR)/man3; \
332done
333
334install_doc: install_doc_html install_doc_man
335
336install: install_bin install_include install_lib install_doc
337
338tests_unit: $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%$(EXE))
339tests_integration: $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%$(EXE))
340tests_stress: $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%$(EXE))
341tests: tests_unit tests_integration tests_stress
342
343check_unit_dir:
344	@mkdir -p $(objroot)test/unit
345check_integration_dir:
346	@mkdir -p $(objroot)test/integration
347stress_dir:
348	@mkdir -p $(objroot)test/stress
349check_dir: check_unit_dir check_integration_dir
350
351check_unit: tests_unit check_unit_dir
352	$(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%)
353check_integration_prof: tests_integration check_integration_dir
354ifeq ($(enable_prof), 1)
355	$(MALLOC_CONF)="prof:true" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
356	$(MALLOC_CONF)="prof:true,prof_active:false" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
357endif
358check_integration: tests_integration check_integration_dir
359	$(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
360stress: tests_stress stress_dir
361	$(SHELL) $(objroot)test/test.sh $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%)
362check: tests check_dir check_integration_prof
363	$(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
364
365ifeq ($(enable_code_coverage), 1)
366coverage_unit: check_unit
367	$(SHELL) $(srcroot)coverage.sh $(srcroot)src jet $(C_JET_OBJS)
368	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src unit $(C_TESTLIB_UNIT_OBJS)
369	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/unit unit $(TESTS_UNIT_OBJS)
370
371coverage_integration: check_integration
372	$(SHELL) $(srcroot)coverage.sh $(srcroot)src pic $(C_PIC_OBJS)
373	$(SHELL) $(srcroot)coverage.sh $(srcroot)src integration $(C_UTIL_INTEGRATION_OBJS)
374	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src integration $(C_TESTLIB_INTEGRATION_OBJS)
375	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/integration integration $(TESTS_INTEGRATION_OBJS)
376
377coverage_stress: stress
378	$(SHELL) $(srcroot)coverage.sh $(srcroot)src pic $(C_PIC_OBJS)
379	$(SHELL) $(srcroot)coverage.sh $(srcroot)src jet $(C_JET_OBJS)
380	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src stress $(C_TESTLIB_STRESS_OBJS)
381	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/stress stress $(TESTS_STRESS_OBJS)
382
383coverage: check
384	$(SHELL) $(srcroot)coverage.sh $(srcroot)src pic $(C_PIC_OBJS)
385	$(SHELL) $(srcroot)coverage.sh $(srcroot)src jet $(C_JET_OBJS)
386	$(SHELL) $(srcroot)coverage.sh $(srcroot)src integration $(C_UTIL_INTEGRATION_OBJS)
387	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src unit $(C_TESTLIB_UNIT_OBJS)
388	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src integration $(C_TESTLIB_INTEGRATION_OBJS)
389	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/src stress $(C_TESTLIB_STRESS_OBJS)
390	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/unit unit $(TESTS_UNIT_OBJS) $(TESTS_UNIT_AUX_OBJS)
391	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/integration integration $(TESTS_INTEGRATION_OBJS)
392	$(SHELL) $(srcroot)coverage.sh $(srcroot)test/stress integration $(TESTS_STRESS_OBJS)
393endif
394
395clean:
396	rm -f $(C_OBJS)
397	rm -f $(C_PIC_OBJS)
398	rm -f $(C_JET_OBJS)
399	rm -f $(C_TESTLIB_OBJS)
400	rm -f $(C_OBJS:%.$(O)=%.d)
401	rm -f $(C_OBJS:%.$(O)=%.gcda)
402	rm -f $(C_OBJS:%.$(O)=%.gcno)
403	rm -f $(C_PIC_OBJS:%.$(O)=%.d)
404	rm -f $(C_PIC_OBJS:%.$(O)=%.gcda)
405	rm -f $(C_PIC_OBJS:%.$(O)=%.gcno)
406	rm -f $(C_JET_OBJS:%.$(O)=%.d)
407	rm -f $(C_JET_OBJS:%.$(O)=%.gcda)
408	rm -f $(C_JET_OBJS:%.$(O)=%.gcno)
409	rm -f $(C_TESTLIB_OBJS:%.$(O)=%.d)
410	rm -f $(C_TESTLIB_OBJS:%.$(O)=%.gcda)
411	rm -f $(C_TESTLIB_OBJS:%.$(O)=%.gcno)
412	rm -f $(TESTS_OBJS:%.$(O)=%$(EXE))
413	rm -f $(TESTS_OBJS)
414	rm -f $(TESTS_OBJS:%.$(O)=%.d)
415	rm -f $(TESTS_OBJS:%.$(O)=%.gcda)
416	rm -f $(TESTS_OBJS:%.$(O)=%.gcno)
417	rm -f $(TESTS_OBJS:%.$(O)=%.out)
418	rm -f $(DSOS) $(STATIC_LIBS)
419	rm -f $(objroot)*.gcov.*
420
421distclean: clean
422	rm -f $(objroot)bin/jemalloc-config
423	rm -f $(objroot)bin/jemalloc.sh
424	rm -f $(objroot)bin/jeprof
425	rm -f $(objroot)config.log
426	rm -f $(objroot)config.status
427	rm -f $(objroot)config.stamp
428	rm -f $(cfghdrs_out)
429	rm -f $(cfgoutputs_out)
430
431relclean: distclean
432	rm -f $(objroot)configure
433	rm -f $(objroot)VERSION
434	rm -f $(DOCS_HTML)
435	rm -f $(DOCS_MAN3)
436
437#===============================================================================
438# Re-configuration rules.
439
440ifeq ($(enable_autogen), 1)
441$(srcroot)configure : $(srcroot)configure.ac
442	cd ./$(srcroot) && $(AUTOCONF)
443
444$(objroot)config.status : $(srcroot)configure
445	./$(objroot)config.status --recheck
446
447$(srcroot)config.stamp.in : $(srcroot)configure.ac
448	echo stamp > $(srcroot)config.stamp.in
449
450$(objroot)config.stamp : $(cfgoutputs_in) $(cfghdrs_in) $(srcroot)configure
451	./$(objroot)config.status
452	@touch $@
453
454# There must be some action in order for make to re-read Makefile when it is
455# out of date.
456$(cfgoutputs_out) $(cfghdrs_out) : $(objroot)config.stamp
457	@true
458endif
459