[PATCH] Remove the objroot variable from the build system

Mike Hommey mh+jemalloc at glandium.org
Thu Apr 12 07:42:20 PDT 2012


From: Mike Hommey <mh at glandium.org>

It is of no use, and is always "".
---
 Makefile.in  |  120 +++++++++++++++++++++++++++++-----------------------------
 configure.ac |    5 +--
 2 files changed, 61 insertions(+), 64 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 8aa9425..da07db4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,7 +19,7 @@ DATADIR := $(DESTDIR)@DATADIR@
 MANDIR := $(DESTDIR)@MANDIR@
 
 # Build parameters.
-CPPFLAGS := @CPPFLAGS@ -I at srcroot@include -I at objroot@include
+CPPFLAGS := @CPPFLAGS@ -I at srcroot@include -Iinclude
 CFLAGS := @CFLAGS@
 ifeq (macho, @abi@)
 CFLAGS += -dynamic
@@ -35,15 +35,15 @@ WL_SONAME := soname
 endif
 REV := @rev@
 ifeq (macho, @abi@)
-TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=@objroot at lib
+TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=lib
 else
 TEST_LIBRARY_PATH :=
 endif
 
 # Lists of files.
-BINS := @srcroot at bin/pprof @objroot at bin/jemalloc.sh
-CHDRS := @objroot at include/jemalloc/jemalloc at install_suffix@.h \
-	@objroot at include/jemalloc/jemalloc_defs at install_suffix@.h
+BINS := @srcroot at bin/pprof bin/jemalloc.sh
+CHDRS := include/jemalloc/jemalloc at install_suffix@.h \
+	include/jemalloc/jemalloc_defs at install_suffix@.h
 CSRCS := @srcroot at src/jemalloc.c @srcroot at src/arena.c @srcroot at src/atomic.c \
 	@srcroot at src/base.c @srcroot at src/bitmap.c @srcroot at src/chunk.c \
 	@srcroot at src/chunk_dss.c @srcroot at src/chunk_mmap.c \
@@ -55,14 +55,14 @@ CSRCS := @srcroot at src/jemalloc.c @srcroot at src/arena.c @srcroot at src/atomic.c \
 ifeq (macho, @abi@)
 CSRCS += @srcroot at src/zone.c
 endif
-STATIC_LIBS := @objroot at lib/libjemalloc at install_suffix@.a
-DSOS := @objroot at lib/libjemalloc at install_suffix@.$(SO).$(REV) \
-	@objroot at lib/libjemalloc at install_suffix@.$(SO) \
-	@objroot at lib/libjemalloc at install_suffix@_pic.a
-MAN3 := @objroot at doc/jemalloc at install_suffix@.3
-DOCS_XML := @objroot at doc/jemalloc at install_suffix@.xml
-DOCS_HTML := $(DOCS_XML:@objroot@%.xml=@srcroot@%.html)
-DOCS_MAN3 := $(DOCS_XML:@objroot@%.xml=@srcroot@%.3)
+STATIC_LIBS := lib/libjemalloc at install_suffix@.a
+DSOS := lib/libjemalloc at install_suffix@.$(SO).$(REV) \
+	lib/libjemalloc at install_suffix@.$(SO) \
+	lib/libjemalloc at install_suffix@_pic.a
+MAN3 := doc/jemalloc at install_suffix@.3
+DOCS_XML := doc/jemalloc at install_suffix@.xml
+DOCS_HTML := $(DOCS_XML:%.xml=@srcroot@%.html)
+DOCS_MAN3 := $(DOCS_XML:%.xml=@srcroot@%.3)
 DOCS := $(DOCS_HTML) $(DOCS_MAN3)
 CTESTS := @srcroot at test/aligned_alloc.c @srcroot at test/allocated.c \
 	@srcroot at test/bitmap.c @srcroot at test/mremap.c \
@@ -77,18 +77,18 @@ endif
 .PHONY: install_html install_man install_doc install
 .PHONY: tests check clean distclean relclean
 
-.SECONDARY : $(CTESTS:@srcroot@%.c=@objroot@%.o)
+.SECONDARY : $(CTESTS:@srcroot@%.c=%.o)
 
 # Default target.
 all: build
 
 dist: build_doc
 
- at srcroot@doc/%.html : @objroot at doc/%.xml @srcroot at doc/stylesheet.xsl @objroot at doc/html.xsl
-	@XSLTPROC@ -o $@ @objroot at doc/html.xsl $<
+ at srcroot@doc/%.html : doc/%.xml @srcroot at doc/stylesheet.xsl doc/html.xsl
+	@XSLTPROC@ -o $@ doc/html.xsl $<
 
- at srcroot@doc/%.3 : @objroot at doc/%.xml @srcroot at doc/stylesheet.xsl @objroot at doc/manpages.xsl
-	@XSLTPROC@ -o $@ @objroot at doc/manpages.xsl $<
+ at srcroot@doc/%.3 : doc/%.xml @srcroot at doc/stylesheet.xsl doc/manpages.xsl
+	@XSLTPROC@ -o $@ doc/manpages.xsl $<
 
 build_doc_html: $(DOCS_HTML)
 build_doc_man: $(DOCS_MAN3)
@@ -97,16 +97,16 @@ build_doc: $(DOCS)
 #
 # Include generated dependency files.
 #
--include $(CSRCS:@srcroot@%.c=@objroot@%.d)
--include $(CSRCS:@srcroot@%.c=@objroot@%.pic.d)
--include $(CTESTS:@srcroot@%.c=@objroot@%.d)
+-include $(CSRCS:@srcroot@%.c=%.d)
+-include $(CSRCS:@srcroot@%.c=%.pic.d)
+-include $(CTESTS:@srcroot@%.c=%.d)
 
- at objroot@src/%.o: @srcroot at src/%.c
+src/%.o: @srcroot at 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)"
 
- at objroot@src/%.pic.o: @srcroot at src/%.c
+src/%.pic.o: @srcroot at src/%.c
 	@mkdir -p $(@D)
 	$(CC) $(CFLAGS) -fPIC -DPIC -c $(CPPFLAGS) -o $@ $<
 	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $(basename $@))))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.pic.o \2/g\" > $(@:%.o=%.d)"
@@ -115,33 +115,33 @@ build_doc: $(DOCS)
 	@mkdir -p $(@D)
 	ln -sf $(<F) $@
 
- at objroot@lib/libjemalloc at install_suffix@.$(SO).$(REV) : $(CSRCS:@srcroot@%.c=@objroot@%.pic.o)
+lib/libjemalloc at install_suffix@.$(SO).$(REV) : $(CSRCS:@srcroot@%.c=%.pic.o)
 	@mkdir -p $(@D)
 	$(CC) -shared -Wl,-$(WL_SONAME),$(@F) $(RPATH_EXTRA:%=@RPATH@%) -o $@ $+ $(LDFLAGS) $(LIBS)
 
- at objroot@lib/libjemalloc at install_suffix@_pic.a : $(CSRCS:@srcroot@%.c=@objroot@%.pic.o)
+lib/libjemalloc at install_suffix@_pic.a : $(CSRCS:@srcroot@%.c=%.pic.o)
 	@mkdir -p $(@D)
 	ar crus $@ $+
 
- at objroot@lib/libjemalloc at install_suffix@.a : $(CSRCS:@srcroot@%.c=@objroot@%.o)
+lib/libjemalloc at install_suffix@.a : $(CSRCS:@srcroot@%.c=%.o)
 	@mkdir -p $(@D)
 	ar crus $@ $+
 
- at objroot@test/%.o: @srcroot at test/%.c
+test/%.o: @srcroot at test/%.c
 	@mkdir -p $(@D)
-	$(CC) $(CFLAGS) -c $(CPPFLAGS) -I at objroot@test -o $@ $<
-	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) -I at objroot@test $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
+	$(CC) $(CFLAGS) -c $(CPPFLAGS) -Itest -o $@ $<
+	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) -Itest $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
 
 # Automatic dependency generation misses #include "*.c".
- at objroot@test/bitmap.o : @objroot at src/bitmap.o
+test/bitmap.o : src/bitmap.o
 
- at objroot@test/%: @objroot at test/%.o \
-		 @objroot at lib/libjemalloc at install_suffix@.$(SO)
+test/%: test/%.o \
+		 lib/libjemalloc at install_suffix@.$(SO)
 	@mkdir -p $(@D)
 ifneq (@RPATH@, )
-	$(CC) -o $@ $< @RPATH@@objroot at lib -L at objroot@lib -ljemalloc at install_suffix@ -lpthread
+	$(CC) -o $@ $< @RPATH at lib -Llib -ljemalloc at install_suffix@ -lpthread
 else
-	$(CC) -o $@ $< -L at objroot@lib -ljemalloc at install_suffix@ -lpthread
+	$(CC) -o $@ $< -Llib -ljemalloc at install_suffix@ -lpthread
 endif
 
 build_lib_shared: $(DSOS)
@@ -164,13 +164,13 @@ done
 
 install_lib_shared: $(DSOS)
 	install -d $(LIBDIR)
-	install -m 755 @objroot at lib/libjemalloc at install_suffix@.$(SO).$(REV) $(LIBDIR)
+	install -m 755 lib/libjemalloc at install_suffix@.$(SO).$(REV) $(LIBDIR)
 	ln -sf libjemalloc at install_suffix@.$(SO).$(REV) $(LIBDIR)/libjemalloc at install_suffix@.$(SO)
 
 install_lib_static: $(DSOS) $(STATIC_LIBS)
 	install -d $(LIBDIR)
-	install -m 755 @objroot at lib/libjemalloc at install_suffix@_pic.a $(LIBDIR)
-	install -m 755 @objroot at lib/libjemalloc at install_suffix@.a $(LIBDIR)
+	install -m 755 lib/libjemalloc at install_suffix@_pic.a $(LIBDIR)
+	install -m 755 lib/libjemalloc at install_suffix@.a $(LIBDIR)
 
 install_lib: install_lib_shared install_lib_static
 
@@ -192,21 +192,21 @@ install_doc: install_doc_html install_doc_man
 
 install: install_bin install_include install_lib install_doc
 
-tests: $(CTESTS:@srcroot@%.c=@objroot@%)
+tests: $(CTESTS:@srcroot@%.c=%)
 
 check: tests
-	@mkdir -p @objroot at test
+	@mkdir -p test
 	@$(SHELL) -c 'total=0; \
 		failures=0; \
 		echo "========================================="; \
-		for t in $(CTESTS:@srcroot@%.c=@objroot@%); do \
+		for t in $(CTESTS:@srcroot@%.c=%); do \
 			total=`expr $$total + 1`; \
 			/bin/echo -n "$${t} ... "; \
 			$(TEST_LIBRARY_PATH) $${t} @abs_srcroot@ @abs_objroot@ \
-			  > @objroot@$${t}.out 2>&1; \
+			  > $${t}.out 2>&1; \
 			if test -e "@srcroot@$${t}.exp"; then \
 				diff -w -u @srcroot@$${t}.exp \
-				  @objroot@$${t}.out >/dev/null 2>&1; \
+				  $${t}.out >/dev/null 2>&1; \
 				fail=$$?; \
 				if test "$${fail}" -eq "1" ; then \
 					failures=`expr $${failures} + 1`; \
@@ -223,26 +223,26 @@ check: tests
 		echo "Failures: $${failures}/$${total}"'
 
 clean:
-	rm -f $(CSRCS:@srcroot@%.c=@objroot@%.o)
-	rm -f $(CSRCS:@srcroot@%.c=@objroot@%.pic.o)
-	rm -f $(CSRCS:@srcroot@%.c=@objroot@%.d)
-	rm -f $(CSRCS:@srcroot@%.c=@objroot@%.pic.d)
-	rm -f $(CTESTS:@srcroot@%.c=@objroot@%)
-	rm -f $(CTESTS:@srcroot@%.c=@objroot@%.o)
-	rm -f $(CTESTS:@srcroot@%.c=@objroot@%.d)
-	rm -f $(CTESTS:@srcroot@%.c=@objroot@%.out)
+	rm -f $(CSRCS:@srcroot@%.c=%.o)
+	rm -f $(CSRCS:@srcroot@%.c=%.pic.o)
+	rm -f $(CSRCS:@srcroot@%.c=%.d)
+	rm -f $(CSRCS:@srcroot@%.c=%.pic.d)
+	rm -f $(CTESTS:@srcroot@%.c=%)
+	rm -f $(CTESTS:@srcroot@%.c=%.o)
+	rm -f $(CTESTS:@srcroot@%.c=%.d)
+	rm -f $(CTESTS:@srcroot@%.c=%.out)
 	rm -f $(DSOS) $(STATIC_LIBS)
 
 distclean: clean
-	rm -rf @objroot at autom4te.cache
-	rm -f @objroot at config.log
-	rm -f @objroot at config.status
-	rm -f @objroot at config.stamp
+	rm -rf autom4te.cache
+	rm -f config.log
+	rm -f config.status
+	rm -f config.stamp
 	rm -f @cfghdrs_out@
 	rm -f @cfgoutputs_out@
 
 relclean: distclean
-	rm -f @objroot at configure
+	rm -f configure
 	rm -f @srcroot at VERSION
 	rm -f $(DOCS_HTML)
 	rm -f $(DOCS_MAN3)
@@ -254,18 +254,18 @@ ifeq (@enable_autogen@, 1)
 @srcroot at configure : @srcroot at configure.ac
 	cd ./@srcroot@ && @AUTOCONF@
 
- at objroot@config.status : @srcroot at configure
-	./@objroot at config.status --recheck
+config.status : @srcroot at configure
+	./config.status --recheck
 
 @srcroot at config.stamp.in : @srcroot at configure.ac
 	echo stamp > @srcroot at config.stamp.in
 
- at objroot@config.stamp : @cfgoutputs_in@ @cfghdrs_in@ @srcroot at configure
-	./@objroot at config.status
+config.stamp : @cfgoutputs_in@ @cfghdrs_in@ @srcroot at configure
+	./config.status
 	@touch $@
 
 # There must be some action in order for make to re-read Makefile when it is
 # out of date.
- at cfgoutputs_out@ @cfghdrs_out@ : @objroot at config.stamp
+ at cfgoutputs_out@ @cfghdrs_out@ : config.stamp
 	@true
 endif
diff --git a/configure.ac b/configure.ac
index 204e6e5..27a9f73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,8 +55,6 @@ AC_SUBST([srcroot])
 abs_srcroot="`cd \"${srcdir}\"; pwd`/"
 AC_SUBST([abs_srcroot])
 
-objroot=""
-AC_SUBST([objroot])
 abs_objroot="`pwd`/"
 AC_SUBST([abs_objroot])
 
@@ -1085,7 +1083,7 @@ AC_HEADER_STDBOOL
 
 AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
   mkdir -p "include/jemalloc/internal"
-  "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
+  "${srcdir}/include/jemalloc/internal/size_classes.sh" > "include/jemalloc/internal/size_classes.h"
 ])
 
 dnl Process .in files.
@@ -1125,7 +1123,6 @@ AC_MSG_RESULT([MANDIR             : ${MANDIR}])
 AC_MSG_RESULT([])
 AC_MSG_RESULT([srcroot            : ${srcroot}])
 AC_MSG_RESULT([abs_srcroot        : ${abs_srcroot}])
-AC_MSG_RESULT([objroot            : ${objroot}])
 AC_MSG_RESULT([abs_objroot        : ${abs_objroot}])
 AC_MSG_RESULT([])
 AC_MSG_RESULT([JEMALLOC_PREFIX    : ${JEMALLOC_PREFIX}])
-- 
1.7.9.5




More information about the jemalloc-discuss mailing list