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