From d8cb7b11ba2bc21c52d343f56d83d6fb3b9db7a6 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 15 May 2011 16:59:30 -0400 Subject: [PATCH] config: more config stuff to config/ subdir, call it from Makefile. I really don't like Makefile.in files when Makefile can just as easily run configure for you if you forget. This also moves some of the junk files to the config/ subdir so they don't (further) clutter the root. Signed-off-by: Avery Pennarun --- .gitignore | 10 ---------- Makefile.in => Makefile | 9 +++++++-- config/.gitignore | 7 +++++++ config/Makefile | 8 ++++++++ config/config.vars.in | 2 ++ configure.sh => config/configure | 2 +- configure.inc => config/configure.inc | 0 configure | 3 +++ lib/bup/_helpers.c | 2 +- 9 files changed, 29 insertions(+), 14 deletions(-) rename Makefile.in => Makefile (94%) create mode 100644 config/.gitignore create mode 100644 config/Makefile create mode 100644 config/config.vars.in rename configure.sh => config/configure (98%) rename configure.inc => config/configure.inc (100%) create mode 100755 configure diff --git a/.gitignore b/.gitignore index 40bf77c..47e1e2e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,13 +17,3 @@ out2[tc] /build *.swp nbproject - -# ignores from configure.sh -Makefile -config.cmd -config.h -config.log -config.mak -config.md -config.sub - diff --git a/Makefile.in b/Makefile similarity index 94% rename from Makefile.in rename to Makefile index e02fb65..8558c77 100644 --- a/Makefile.in +++ b/Makefile @@ -56,11 +56,17 @@ install: all %/clean: $(MAKE) -C $* clean + +config/config.h: config/Makefile config/configure config/configure.inc \ + $(wildcard config/*.in) + cd config && make config.h lib/bup/_helpers$(SOEXT): \ + config/config.h \ lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py @rm -f $@ - cd lib/bup && LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build + cd lib/bup && \ + LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/ .PHONY: lib/bup/_version.py @@ -151,4 +157,3 @@ clean: Documentation/clean rm -rf *.tmp t/*.tmp lib/*/*/*.tmp build lib/bup/build if test -e testfs; then rmdir testfs; fi if test -e lib/bup/t/testfs; then rmdir lib/bup/t/testfs; fi - rm -f @CONFIGURE_FILES@ @GENERATED_FILES@ diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..6f65774 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,7 @@ +config.cmd +config.h +config.log +config.mak +config.md +config.sub +config.vars \ No newline at end of file diff --git a/config/Makefile b/config/Makefile new file mode 100644 index 0000000..451e49d --- /dev/null +++ b/config/Makefile @@ -0,0 +1,8 @@ +-include config.vars + +config.h: configure configure.inc $(wildcard *.in) + ./configure + +clean: + rm -f ${CONFIGURE_FILES} ${GENERATED_FILES} + rm -f *~ .*~ diff --git a/config/config.vars.in b/config/config.vars.in new file mode 100644 index 0000000..7bc32ee --- /dev/null +++ b/config/config.vars.in @@ -0,0 +1,2 @@ +CONFIGURE_FILES=@CONFIGURE_FILES@ +GENERATED_FILES=@GENERATED_FILES@ diff --git a/configure.sh b/config/configure similarity index 98% rename from configure.sh rename to config/configure index c4234cf..19cac07 100755 --- a/configure.sh +++ b/config/configure @@ -54,4 +54,4 @@ AC_CHECK_HEADERS sys/stat.h AC_CHECK_FUNCS utimensat AC_CHECK_FUNCS utime -AC_OUTPUT Makefile +AC_OUTPUT config.vars diff --git a/configure.inc b/config/configure.inc similarity index 100% rename from configure.inc rename to config/configure.inc diff --git a/configure b/configure new file mode 100755 index 0000000..d9626dc --- /dev/null +++ b/configure @@ -0,0 +1,3 @@ +#!/bin/sh +cd config && +exec ./configure "$@" diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index baa0c03..a0656cc 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -1,6 +1,6 @@ #define _LARGEFILE64_SOURCE 1 #undef NDEBUG -#include "../../config.h" +#include "../../config/config.h" #include "bupsplit.h" #include #include -- 2.39.5