From: Sebastien GODARD Date: Mon, 6 Apr 2015 15:58:25 +0000 (+0200) Subject: Add squeeze target to Makefile X-Git-Tag: v11.1.4~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c253c24e1ddba73464442f64957cef69646ec8f1;p=sysstat Add squeeze target to Makefile Add handy "squeeze" target to Makefile, used to remove unneeded trailing spaces and tabs in source code. Signed-off-by: Sebastien GODARD --- diff --git a/Makefile.in b/Makefile.in index 3ec0a88..bc015b3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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)'; \