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