Makefile.in 16 KB

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