Improve "make cleanup-style" to touch only files that have to be fixed

This commit is contained in:
Volker Grabsch 2012-03-30 09:12:14 +02:00
parent c7f62b02ca
commit 9c79bd37ae
1 changed files with 6 additions and 3 deletions

View File

@ -220,14 +220,17 @@ update-checksum-%:
cleanup-style:
@$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\
echo '[cleanup] $(FILE)'; \
$(SED) -i ' \
$(SED) ' \
s/\r//g; \
s/[ \t]\+$$//; \
s,^#!/bin/bash$$,#!/usr/bin/env bash,; \
$(if $(filter %Makefile,$(FILE)),,\
s/\t/ /g; \
) \
' $(FILE); \
' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \
diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \
|| { echo '[cleanup] $(FILE)'; \
cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \
rm -f $(TOP_DIR)/tmp-cleanup-style; \
)