# Clear out all vpaths, then set just one (default vpath) for the main build # directory. vpath vpath % . # Clear the default suffixes, so that built-in rules are not used. .SUFFIXES : SHELL := /bin/sh CC := @CC@ # Configuration parameters. DESTDIR = BINDIR := $(DESTDIR)@BINDIR@ INCLUDEDIR := $(DESTDIR)@INCLUDEDIR@ LIBDIR := $(DESTDIR)@LIBDIR@ MANDIR := $(DESTDIR)@MANDIR@ # Build parameters. CPPFLAGS := @CPPFLAGS@ -I@srcroot@include -I@objroot@include CFLAGS := @CFLAGS@ -fPIC -DPIC ifeq (macho, @abi@) CFLAGS += -dynamic endif LDFLAGS := @LDFLAGS@ LIBS := @LIBS@ RPATH_EXTRA := @RPATH_EXTRA@ ifeq (macho, @abi@) SO := dylib else SO := so endif REV := 0 # Lists of files. BINS := @srcroot@bin/pprof CHDRS := @objroot@include/jemalloc/jemalloc@install_suffix@.h \ @objroot@include/jemalloc/jemalloc_defs@install_suffix@.h CSRCS := @srcroot@src/jemalloc.c @srcroot@src/arena.c @srcroot@src/base.c \ @srcroot@src/chunk.c @srcroot@src/chunk_dss.c \ @srcroot@src/chunk_mmap.c @srcroot@src/chunk_swap.c @srcroot@src/ckh.c \ @srcroot@src/ctl.c @srcroot@src/extent.c @srcroot@src/hash.c \ @srcroot@src/huge.c @srcroot@src/mb.c @srcroot@src/mutex.c \ @srcroot@src/prof.c @srcroot@src/stats.c @srcroot@src/tcache.c DSOS := @objroot@lib/libjemalloc@install_suffix@.so.$(REV) \ @objroot@lib/libjemalloc@install_suffix@.so \ @objroot@lib/libjemalloc@install_suffix@_pic.a MAN3 := @objroot@doc/jemalloc@install_suffix@.3 .PHONY: all dist install check clean distclean relclean # Default target. all: $(DSOS) # # Include generated dependency files. # -include $(CSRCS:@srcroot@%.c=@objroot@%.d) @objroot@src/%.o: @srcroot@src/%.c @mkdir -p $(@D) $(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $< @$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)" %.so : %.so.$(REV) @mkdir -p $(@D) ln -sf $( @srcroot@config.stamp.in @objroot@config.stamp : @cfgoutputs_in@ @cfghdrs_in@ @srcroot@configure ./@objroot@config.status @touch $@ # There must be some action in order for make to re-read Makefile when it is # out of date. @cfgoutputs_out@ @cfghdrs_out@ : @objroot@config.stamp @true endif