diff mbox

[08/10] btrfs-progs: clean generated files, make version.h stuff more robust

Message ID 1418387724-20188-9-git-send-email-kzak@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Karel Zak Dec. 12, 2014, 12:35 p.m. UTC
- add rule to generated version.h when any relevant stuff changed
- add rule to clean generated files on "make clean-all"

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 Makefile.in | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/Makefile.in b/Makefile.in
index 58200ca..df752d3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -164,6 +164,10 @@  test:
 #
 static: $(progs_static)
 
+version.h: version.sh version.h.in configure.ac
+	@echo "    [SH]     $@"
+	$(Q)bash ./config.status --silent $@
+
 $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(LDFLAGS) $(LIBBTRFS_LIBS) \
@@ -271,14 +275,15 @@  test-build:
 manpages:
 	$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
 
-clean-all: clean-doc clean
+
+clean-all: clean clean-doc clean-gen
 
 clean: $(CLEANDIRS)
 	@echo "Cleaning"
 	$(Q)rm -f $(progs) cscope.out *.o *.o.d \
 	      dir-test ioctl-test quick-test send-test library-test library-test-static \
 	      btrfs.static mkfs.btrfs.static \
-	      version.h $(check_defs) \
+	      $(check_defs) \
 	      $(libs) $(lib_links) \
 	      $(progs_static) $(progs_extra)
 
@@ -286,6 +291,11 @@  clean-doc:
 	@echo "Cleaning Documentation"
 	$(Q)$(MAKE) $(MAKEOPTS) -C Documentation clean
 
+clean-gen:
+	@echo "Cleaning Generated Files"
+	$(Q)rm -f version.h config.status config.cache connfig.log \
+		configure.lineno config.status.lineno Makefile
+
 $(CLEANDIRS):
 	@echo "Cleaning $(patsubst clean-%,%,$@)"
 	$(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst clean-%,%,$@) clean