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@ |
| 29 | LIBS := @LIBS@ |
| 30 | RPATH_EXTRA := @RPATH_EXTRA@ |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 31 | SO := @so@ |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 32 | O := @o@ |
| 33 | A := @a@ |
| 34 | EXE := @exe@ |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 35 | LIBPREFIX := @libprefix@ |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 36 | REV := @rev@ |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 37 | install_suffix := @install_suffix@ |
| 38 | ABI := @abi@ |
| 39 | XSLTPROC := @XSLTPROC@ |
| 40 | AUTOCONF := @AUTOCONF@ |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 41 | _RPATH = @RPATH@ |
| 42 | RPATH = $(if $(1),$(call _RPATH,$(1))) |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 43 | cfghdrs_in := @cfghdrs_in@ |
| 44 | cfghdrs_out := @cfghdrs_out@ |
| 45 | cfgoutputs_in := @cfgoutputs_in@ |
| 46 | cfgoutputs_out := @cfgoutputs_out@ |
| 47 | enable_autogen := @enable_autogen@ |
| 48 | enable_experimental := @enable_experimental@ |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 49 | DSO_LDFLAGS = @DSO_LDFLAGS@ |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 50 | SOREV = @SOREV@ |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 51 | PIC_CFLAGS = @PIC_CFLAGS@ |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 52 | |
| 53 | ifeq (macho, $(ABI)) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 54 | TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH="$(objroot)lib" |
| 55 | else |
| 56 | ifeq (pecoff, $(ABI)) |
| 57 | TEST_LIBRARY_PATH := PATH="$(PATH):$(objroot)lib" |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 58 | else |
| 59 | TEST_LIBRARY_PATH := |
| 60 | endif |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 61 | endif |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 62 | |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 63 | LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix) |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 64 | |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 65 | # Lists of files. |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 66 | BINS := $(srcroot)bin/pprof $(objroot)bin/jemalloc.sh |
| 67 | CHDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h \ |
| 68 | $(objroot)include/jemalloc/jemalloc_defs$(install_suffix).h |
| 69 | CSRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c $(srcroot)src/atomic.c \ |
| 70 | $(srcroot)src/base.c $(srcroot)src/bitmap.c $(srcroot)src/chunk.c \ |
| 71 | $(srcroot)src/chunk_dss.c $(srcroot)src/chunk_mmap.c \ |
| 72 | $(srcroot)src/ckh.c $(srcroot)src/ctl.c $(srcroot)src/extent.c \ |
| 73 | $(srcroot)src/hash.c $(srcroot)src/huge.c $(srcroot)src/mb.c \ |
| 74 | $(srcroot)src/mutex.c $(srcroot)src/prof.c $(srcroot)src/quarantine.c \ |
| 75 | $(srcroot)src/rtree.c $(srcroot)src/stats.c $(srcroot)src/tcache.c \ |
| 76 | $(srcroot)src/util.c $(srcroot)src/tsd.c |
| 77 | ifeq (macho, $(ABI)) |
| 78 | CSRCS += $(srcroot)src/zone.c |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 79 | endif |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 80 | STATIC_LIBS := $(objroot)lib/$(LIBJEMALLOC).$(A) |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 81 | ifdef PIC_CFLAGS |
| 82 | STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_pic.$(A) |
| 83 | endif |
| 84 | DSOS := $(objroot)lib/$(LIBJEMALLOC).$(SOREV) |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 85 | ifneq ($(SOREV),$(SO)) |
| 86 | DSOS += $(objroot)lib/$(LIBJEMALLOC).$(SO) |
| 87 | endif |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 88 | MAN3 := $(objroot)doc/jemalloc$(install_suffix).3 |
| 89 | DOCS_XML := $(objroot)doc/jemalloc$(install_suffix).xml |
| 90 | DOCS_HTML := $(DOCS_XML:$(objroot)%.xml=$(srcroot)%.html) |
| 91 | DOCS_MAN3 := $(DOCS_XML:$(objroot)%.xml=$(srcroot)%.3) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 92 | DOCS := $(DOCS_HTML) $(DOCS_MAN3) |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 93 | CTESTS := $(srcroot)test/aligned_alloc.c $(srcroot)test/allocated.c \ |
| 94 | $(srcroot)test/bitmap.c $(srcroot)test/mremap.c \ |
| 95 | $(srcroot)test/posix_memalign.c $(srcroot)test/thread_arena.c \ |
| 96 | $(srcroot)test/thread_tcache_enabled.c |
| 97 | ifeq ($(enable_experimental), 1) |
| 98 | CTESTS += $(srcroot)test/allocm.c $(srcroot)test/rallocm.c |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 99 | endif |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 100 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 101 | COBJS := $(CSRCS:$(srcroot)%.c=$(objroot)%.$(O)) |
| 102 | CPICOBJS := $(CSRCS:$(srcroot)%.c=$(objroot)%.pic.$(O)) |
| 103 | CTESTOBJS := $(CTESTS:$(srcroot)%.c=$(objroot)%.$(O)) |
| 104 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 105 | .PHONY: all dist doc_html doc_man doc |
| 106 | .PHONY: install_bin install_include install_lib |
| 107 | .PHONY: install_html install_man install_doc install |
| 108 | .PHONY: tests check clean distclean relclean |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 109 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 110 | .SECONDARY : $(CTESTOBJS) |
Jason Evans | 9dcad2d | 2011-02-13 18:11:54 -0800 | [diff] [blame] | 111 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 112 | # Default target. |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 113 | all: build |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 114 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 115 | dist: build_doc |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 116 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 117 | $(srcroot)doc/%.html : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/html.xsl |
| 118 | $(XSLTPROC) -o $@ $(objroot)doc/html.xsl $< |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 119 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 120 | $(srcroot)doc/%.3 : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/manpages.xsl |
| 121 | $(XSLTPROC) -o $@ $(objroot)doc/manpages.xsl $< |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 122 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 123 | build_doc_html: $(DOCS_HTML) |
| 124 | build_doc_man: $(DOCS_MAN3) |
| 125 | build_doc: $(DOCS) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 126 | |
Jason Evans | e476f8a | 2010-01-16 09:53:50 -0800 | [diff] [blame] | 127 | # |
| 128 | # Include generated dependency files. |
| 129 | # |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 130 | -include $(COBJS:%.$(O)=%.d) |
| 131 | -include $(CPICOBJS:%.$(O)=%.d) |
| 132 | -include $(CTESTOBJS:%.$(O)=%.d) |
Jason Evans | e476f8a | 2010-01-16 09:53:50 -0800 | [diff] [blame] | 133 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 134 | $(COBJS): $(objroot)src/%.$(O): $(srcroot)src/%.c |
| 135 | $(CPICOBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.c |
| 136 | $(CPICOBJS): CFLAGS += $(PIC_CFLAGS) |
| 137 | $(CTESTOBJS): $(objroot)test/%.$(O): $(srcroot)test/%.c |
| 138 | $(CTESTOBJS): CPPFLAGS += -I$(objroot)test |
| 139 | |
| 140 | $(COBJS) $(CPICOBJS) $(CTESTOBJS): %.$(O): |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 141 | @mkdir -p $(@D) |
Jason Evans | 79a7869 | 2010-01-03 16:17:55 -0800 | [diff] [blame] | 142 | $(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $< |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 143 | @$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $< |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 144 | |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 145 | ifneq ($(SOREV),$(SO)) |
| 146 | %.$(SO) : %.$(SOREV) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 147 | @mkdir -p $(@D) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 148 | ln -sf $(<F) $@ |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 149 | endif |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 150 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 151 | $(objroot)lib/$(LIBJEMALLOC).$(SOREV) : $(if $(PIC_CFLAGS),$(CPICOBJS),$(COBJS)) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 152 | @mkdir -p $(@D) |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 153 | $(CC) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) -o $@ $+ $(LDFLAGS) $(LIBS) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 154 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 155 | $(objroot)lib/$(LIBJEMALLOC)_pic.$(A) : $(CPICOBJS) |
| 156 | $(objroot)lib/$(LIBJEMALLOC).$(A) : $(COBJS) |
| 157 | |
| 158 | $(STATIC_LIBS): |
Arun Sharma | af5d698 | 2011-02-15 14:13:38 -0800 | [diff] [blame] | 159 | @mkdir -p $(@D) |
| 160 | ar crus $@ $+ |
| 161 | |
Mike Hommey | 45f208e | 2012-04-16 16:30:26 +0200 | [diff] [blame] | 162 | $(objroot)test/bitmap$(EXE): $(objroot)src/bitmap.$(O) |
| 163 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 164 | $(objroot)test/%$(EXE): $(objroot)test/%.$(O) $(objroot)src/util.$(O) $(DSOS) |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 165 | @mkdir -p $(@D) |
Mike Hommey | 45f208e | 2012-04-16 16:30:26 +0200 | [diff] [blame] | 166 | $(CC) -o $@ $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) -L$(objroot)lib -ljemalloc$(install_suffix) $(LIBS) |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 167 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 168 | build_lib_shared: $(DSOS) |
| 169 | build_lib_static: $(STATIC_LIBS) |
| 170 | build: build_lib_shared build_lib_static |
| 171 | |
Jason Evans | a91f210 | 2010-04-02 13:50:53 -0700 | [diff] [blame] | 172 | install_bin: |
| 173 | install -d $(BINDIR) |
| 174 | @for b in $(BINS); do \ |
| 175 | echo "install -m 755 $$b $(BINDIR)"; \ |
| 176 | install -m 755 $$b $(BINDIR); \ |
| 177 | done |
| 178 | |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 179 | install_include: |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 180 | install -d $(INCLUDEDIR)/jemalloc |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 181 | @for h in $(CHDRS); do \ |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 182 | echo "install -m 644 $$h $(INCLUDEDIR)/jemalloc"; \ |
| 183 | install -m 644 $$h $(INCLUDEDIR)/jemalloc; \ |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 184 | done |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 185 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 186 | install_lib_shared: $(DSOS) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 187 | install -d $(LIBDIR) |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 188 | install -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR) |
| 189 | ifneq ($(SOREV),$(SO)) |
| 190 | ln -sf $(LIBJEMALLOC).$(SOREV) $(LIBDIR)/$(LIBJEMALLOC).$(SO) |
| 191 | endif |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 192 | |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 193 | install_lib_static: $(STATIC_LIBS) |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 194 | install -d $(LIBDIR) |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 195 | @for l in $(STATIC_LIBS); do \ |
| 196 | echo "install -m 755 $$l $(LIBDIR)"; \ |
| 197 | install -m 755 $$l $(LIBDIR); \ |
| 198 | done |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 199 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 200 | install_lib: install_lib_shared install_lib_static |
| 201 | |
| 202 | install_doc_html: |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 203 | install -d $(DATADIR)/doc/jemalloc$(install_suffix) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 204 | @for d in $(DOCS_HTML); do \ |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 205 | echo "install -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix)"; \ |
| 206 | install -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix); \ |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 207 | done |
| 208 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 209 | install_doc_man: |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 210 | install -d $(MANDIR)/man3 |
| 211 | @for d in $(DOCS_MAN3); do \ |
| 212 | echo "install -m 644 $$d $(MANDIR)/man3"; \ |
| 213 | install -m 644 $$d $(MANDIR)/man3; \ |
| 214 | done |
| 215 | |
Jason Evans | 7b398ac | 2012-03-02 16:38:37 -0800 | [diff] [blame] | 216 | install_doc: install_doc_html install_doc_man |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 217 | |
| 218 | install: install_bin install_include install_lib install_doc |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 219 | |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 220 | tests: $(CTESTS:$(srcroot)%.c=$(objroot)%$(EXE)) |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 221 | |
| 222 | check: tests |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 223 | @mkdir -p $(objroot)test |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 224 | @$(SHELL) -c 'total=0; \ |
| 225 | failures=0; \ |
| 226 | echo "========================================="; \ |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 227 | for t in $(CTESTS:$(srcroot)%.c=$(objroot)%); do \ |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 228 | total=`expr $$total + 1`; \ |
| 229 | /bin/echo -n "$${t} ... "; \ |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 230 | $(TEST_LIBRARY_PATH) $${t}$(EXE) $(abs_srcroot) $(abs_objroot) \ |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 231 | > $(objroot)$${t}.out 2>&1; \ |
| 232 | if test -e "$(srcroot)$${t}.exp"; then \ |
| 233 | diff -w -u $(srcroot)$${t}.exp \ |
| 234 | $(objroot)$${t}.out >/dev/null 2>&1; \ |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 235 | fail=$$?; \ |
| 236 | if test "$${fail}" -eq "1" ; then \ |
| 237 | failures=`expr $${failures} + 1`; \ |
| 238 | echo "*** FAIL ***"; \ |
| 239 | else \ |
| 240 | echo "pass"; \ |
| 241 | fi; \ |
| 242 | else \ |
| 243 | echo "*** FAIL *** (.exp file is missing)"; \ |
| 244 | failures=`expr $${failures} + 1`; \ |
| 245 | fi; \ |
| 246 | done; \ |
| 247 | echo "========================================="; \ |
| 248 | echo "Failures: $${failures}/$${total}"' |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 249 | |
| 250 | clean: |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 251 | rm -f $(COBJS) |
| 252 | rm -f $(CPICOBJS) |
| 253 | rm -f $(COBJS:%.$(O)=%.d) |
| 254 | rm -f $(CPICOBJS:%.$(O)=%.d) |
| 255 | rm -f $(CTESTOBJS:%.$(O)=%$(EXE)) |
| 256 | rm -f $(CTESTOBJS) |
| 257 | rm -f $(CTESTOBJS:%.$(O)=%.d) |
| 258 | rm -f $(CTESTOBJS:%.$(O)=%.out) |
Arun Sharma | af5d698 | 2011-02-15 14:13:38 -0800 | [diff] [blame] | 259 | rm -f $(DSOS) $(STATIC_LIBS) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 260 | |
| 261 | distclean: clean |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 262 | rm -rf $(objroot)autom4te.cache |
| 263 | rm -f $(objroot)config.log |
| 264 | rm -f $(objroot)config.status |
| 265 | rm -f $(objroot)config.stamp |
| 266 | rm -f $(cfghdrs_out) |
| 267 | rm -f $(cfgoutputs_out) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 268 | |
| 269 | relclean: distclean |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 270 | rm -f $(objroot)configure |
| 271 | rm -f $(srcroot)VERSION |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 272 | rm -f $(DOCS_HTML) |
| 273 | rm -f $(DOCS_MAN3) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 274 | |
| 275 | #=============================================================================== |
| 276 | # Re-configuration rules. |
| 277 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 278 | ifeq ($(enable_autogen), 1) |
| 279 | $(srcroot)configure : $(srcroot)configure.ac |
| 280 | cd ./$(srcroot) && $(AUTOCONF) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 281 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 282 | $(objroot)config.status : $(srcroot)configure |
| 283 | ./$(objroot)config.status --recheck |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 284 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 285 | $(srcroot)config.stamp.in : $(srcroot)configure.ac |
| 286 | echo stamp > $(srcroot)config.stamp.in |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 287 | |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 288 | $(objroot)config.stamp : $(cfgoutputs_in) $(cfghdrs_in) $(srcroot)configure |
| 289 | ./$(objroot)config.status |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 290 | @touch $@ |
| 291 | |
| 292 | # There must be some action in order for make to re-read Makefile when it is |
| 293 | # out of date. |
Mike Hommey | 2d04f5e | 2012-04-16 16:30:22 +0200 | [diff] [blame] | 294 | $(cfgoutputs_out) $(cfghdrs_out) : $(objroot)config.stamp |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 295 | @true |
| 296 | endif |