]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Omkize target always creates Makefile wherever Makefile.omk exists
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 11 Nov 2013 10:30:06 +0000 (11:30 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 11 Nov 2013 10:30:06 +0000 (11:30 +0100)
Previously, it only rewrote existing Makefiles, which was not so useful
for new projects.

Added test for omkize target.

snippets/base.omk
tests/Makefile
tests/omkize [new file with mode: 0755]

index a50de01d065d11af357b64d9b69b2ed8d1090031..3b811ec776c2b88ba175a6cd7e7af0f960aeb71e 100644 (file)
@@ -1,7 +1,7 @@
 #  Makefile.rules - OCERA make framework common project rules -*- makefile-gmake -*-
 #
 #  (C) Copyright 2003, 2006, 2007, 2008, 2009  by Pavel Pisa - OCERA team member
-#  (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011 by Michal Sojka - Czech Technical University, FEE, DCE
+#  (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013 by Michal Sojka - Czech Technical University, FEE, DCE
 #
 #  Homepage: http://rtime.felk.cvut.cz/omk/
 #  Version:  @git-describe@
@@ -298,7 +298,7 @@ omkize:
        fi
        $(Q)for i in `find -L . -name Makefile.omk` ; do \
           d=`dirname $${i}`; \
-          if ! test -f "$${d}/Makefile.rules" && ( test -f "$${d}/Makefile" && ! cmp -s Makefile "$${d}/Makefile" ); then \
+          if ! test -f "$${d}/Makefile.rules" && ! cmp -s Makefile "$${d}/Makefile"; then \
              rm -f "$${d}/Makefile"; \
              cp -v Makefile "$${d}/Makefile"; \
           fi \
index 8ac0efad1c5e65b7ca149903a3394df7d3f7f079..24a460c5a803ee36ab19b8dbb07e2de7b0e164b0 100644 (file)
@@ -7,7 +7,7 @@ no_vpath omk_config override-config parallel_make programs              \
 programs-cflags programs-cxxflags programs-cflags-cmdline programs-defs        \
 programs-test_PROGRAMS qt qt-qmake shlibs sources_dir                  \
 sources_in_subdirectory sources_list subdirs_first                     \
-subdirs_first-force-subdir use_leaf_makefiles vxworks whole_tree
+subdirs_first-force-subdir use_leaf_makefiles vxworks whole_tree omkize
 
 
 all test:
diff --git a/tests/omkize b/tests/omkize
new file mode 100755 (executable)
index 0000000..7acb6ae
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+. ./wvtest.sh
+
+WVSTART omkize
+echo "SUBDIRS = dir" > Makefile.omk
+omkize
+touch config.omk-default
+mkdir dir
+touch dir/Makefile.omk
+WVPASS make omkize
+WVPASS test -f dir/Makefile
+WVPASS cmp Makefile dir/Makefile