diff Makefile @ 2357:5a0c2bf69e55

Add new command "make cleanup-style"
author Volker Grabsch <vog@notjusthosting.com>
date Thu, 29 Mar 2012 13:00:17 +0200
parents c15638fca657
children 1726cefccf0c
line wrap: on
line diff
--- a/Makefile	Thu Mar 29 12:27:58 2012 +0200
+++ b/Makefile	Thu Mar 29 13:00:17 2012 +0200
@@ -218,3 +218,16 @@
 	$(call DOWNLOAD_PKG_ARCHIVE,$*)
 	$(SED) -i 's/^\([^ ]*_CHECKSUM *:=\).*/\1 '"`$(call PKG_CHECKSUM,$*)`"'/' '$(TOP_DIR)/src/$*.mk'
 
+cleanup-style:
+	@$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\
+            echo '[cleanup] $(FILE)'; \
+            $(SED) -i ' \
+                s/\r//g; \
+                s/[ \t]\+$$//; \
+                s,^#!/bin/bash$$,#!/usr/bin/env bash,; \
+                $(if $(filter %Makefile,$(FILE)),,\
+                    s/\t/    /g; \
+                ) \
+            ' $(FILE); \
+        )
+