]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added target omkize, which replaces all Makefiles in subdirectories with Makefile...
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 17 Oct 2007 16:07:00 +0000 (16:07 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 17 Oct 2007 16:07:00 +0000 (16:07 +0000)
darcs-hash:20071017160711-f2ef6-48da8d2f361dd2a5015be6aedb50bdd9c8049810.gz

snippets/base

index 5bb742486e37eb0defd5ca4275a4a779f8e9e6a7..c5e0612c87c98828dbadae480f1c1304261948c6 100644 (file)
@@ -17,7 +17,7 @@ ifndef SOURCES_DIR
 SOURCES_DIR := $(shell ( pwd -L ) )
 endif
 
-.PHONY: all default check-make-ver
+.PHONY: all default check-make-ver omkize
 
 ifdef W
   ifeq ("$(origin W)", "command line")
@@ -181,3 +181,15 @@ default-config-pass-local:
        @$(foreach x, $(default_CONFIG), echo '$(x)' | \
                sed -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
 
+
+omkize:
+       $(Q)if ! grep -q MAKERULES_DIR Makefile; then \
+          echo "Makefile is not OMK leaf makefile!" >&2; exit 1; \
+       fi
+       $(Q)for i in `find -L . -name Makefile.omk` ; do \
+          i=`dirname $${i}`; \
+          if [ x"$$i" != x"." ]; then \
+             rm -f $${i}/Makefile; \
+             cp Makefile $${i}/Makefile; \
+          fi \
+       done