I've clean my signalfd test case up with autoconf. After applying the patch, do at ltp/
autoconf
autoheader
./configure
make (or cd testcases/kernel/syscalls/signalfd; make)
Benefits are:
- signalfd01.c doesn't depends on kernel version (it used KERNEL_VERSION macro.)
- Makefile becomes simple.
- #ifdef/#endif of signalfd01.c becomes readable.
- signalfd.m4 can use other program than ltp.
I revisied my patch.
- signalfd.m4 is renamed to ltp-signalfd.m4.
- configure is run by make if config.h is older than config.h.in.
- autoconf is run by make if configure is older than configure.ac.
- autoheader is run by make if config.h.in is older than configure.ac.
- dist-clean, a new make target, removes autom4te.cache, config.log and config.status.
- maintainer-clean, a new make target, removes configure and config.h.in.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>.
diff --git a/Makefile b/Makefile
index de0e5c8..b7c1807 100644
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,8 @@
-include config.mk
-all: libltp.a
+VPATH += include m4
+all: config.h libltp.a
@$(MAKE) -C pan $@
@$(MAKE) -C testcases $@
@$(MAKE) -C tools $@
@@ -59,6 +60,7 @@
@$(MAKE) -C lib install
@$(MAKE) -C include install
@$(MAKE) -C pan install
+ @$(MAKE) -C m4 install
@$(MAKE) -C doc/man1 install
@$(MAKE) -C doc/man3 install
@@ -87,13 +89,38 @@
menuconfig:
@./ltpmenu
-clean:
+clean: dist-clean ac-dist-clean
@$(MAKE) -C lib $@
@$(MAKE) -C pan $@
@$(MAKE) -C tools $@
@$(MAKE) -C testcases $@
+dist-clean: clean ac-dist-clean
+ @$(MAKE) -C include $@
+
+maintainer-clean: dist-clean ac-maintainer-clean
+ @$(MAKE) -C include $@
+
package:
rpmbuild -ba ltp-devel.spec
+#
+# Autoconf related
+#
+config.h: config.h.in configure
+ ./configure
+
+config.h.in: configure.ac
+ autoheader
+
+configure: configure.ac $(notdir $(wildcard m4/*.m4))
+ autoconf
+
+.PHONY: ac-dist-clean ac-maintainer-clean
+ac-dist-clean:
+ rm -rf autom4te.cache
+ rm -f config.log config.status
+
+ac-maintainer-clean:
+ rm -f configure