]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Fixed omkize target.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 1 Apr 2008 16:24:00 +0000 (16:24 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 1 Apr 2008 16:24:00 +0000 (16:24 +0000)
Now omkize does not overwrite Makefiles in directories with
Makefile.rules present and where no change is necessary.

darcs-hash:20080401162432-f2ef6-e2b3f52bfd7696497d3ee8a91c6fc3aa17a7f024.gz

snippets/base

index 61d1a608414fa0ed7c962eee5b1b573e378ffb6f..5268810cc405121864220016ac95af3a678e9802 100644 (file)
@@ -221,9 +221,9 @@ omkize:
           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; \
+          d=`dirname $${i}`; \
+          if ! test -f "$${d}/Makefile.rules" && ( ! test -f "$${d}/Makefile" || ! cmp --silent Makefile "$${d}/Makefile" ); then \
+             rm -f "$${d}/Makefile"; \
+             cp -v Makefile "$${d}/Makefile"; \
           fi \
        done