]> granicus.if.org Git - sysstat/commitdiff
Add squeeze target to Makefile
authorSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 6 Apr 2015 15:58:25 +0000 (17:58 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 6 Apr 2015 15:58:25 +0000 (17:58 +0200)
Add handy "squeeze" target to Makefile, used to remove unneeded trailing
spaces and tabs in source code.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
Makefile.in

index 3ec0a88c9d7c3a647997a65f44ef336f9a485026..bc015b33aafca6172bb2200eb6d7591ad897637f 100644 (file)
@@ -147,6 +147,8 @@ ifndef INITD_DIR
 INITD_DIR = @INITD_DIR@
 endif
 
+SOURCE_CODE= $(wildcard *.c *.h)
+
 NLSPO= $(wildcard nls/*.po)
 NLSGMO= $(NLSPO:.po=.gmo)
 NLSPOT= $(NLSPO:.po=.pot)
@@ -268,7 +270,7 @@ nls/sysstat.pot: $(wildcard *.c)
 
 # Phony targets
 .PHONY: clean distclean install install_base install_all uninstall \
-       uninstall_base uninstall_all dist bdist xdist gitdist
+       uninstall_base uninstall_all dist bdist xdist gitdist squeeze
 
 install_man: man/sadc.8 man/sar.1 man/sadf.1 man/sa1.8 man/sa2.8 man/sysstat.5
 ifeq ($(INSTALL_DOC),y)
@@ -318,6 +320,14 @@ endif
 endif
 endif
 
+squeeze:
+       catalogs="$(SOURCE_CODE)"; \
+       for c in $$catalogs; do \
+               echo "Squeezing file: $$c"; \
+               sed 's/[\t ]*$$//g' $$c > squeeze.tmp; \
+               mv squeeze.tmp $$c; \
+       done
+
 install_nls: locales
 ifdef REQUIRE_NLS
        catalogs='$(NLSGMO)'; \