]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Splitting of Makefile.rules now works.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Jun 2006 12:27:00 +0000 (12:27 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Jun 2006 12:27:00 +0000 (12:27 +0000)
darcs-hash:20060615122701-f2ef6-25e9b36bdfde762ea59532b04b5e4486c9bf2561.gz

Makefile
omkbuild.py

index 54200ba537cda91dbd910ee286188beda1636a28..f1084e76c8eeb8922047e2789b0ace87b83b9c7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,4 +5,4 @@ all:
        ./omkbuild.py --all
 
 split:
-       ./omkbuild.py --split=Makefile.rules
\ No newline at end of file
+       cd snippets; ../omkbuild.py --split=../Makefile.rules
\ No newline at end of file
index 3554e6485eb49900209226192094c1e3b260b324..52cb54fc2105b61456f1e47006d5a879d787d10c 100755 (executable)
@@ -23,9 +23,9 @@ Snippet syntax:
      as they are in snippets i.e. copyrights, documentations and rules.
 
    * On the first line of each part of the Makefile.rules, there is
-     special mart of the form #OMK@<snippet file name><EOL>. This mark
-     is used for splitting Makefile.rules back to the original
-     snippets.
+     special mark of the form #OMK@<snippet file name><EOL>. This mark
+     is used for splitting modified Makefile.rules back to the
+     original snippets.
 
 """
 
@@ -276,7 +276,8 @@ def splitRules(rulesFN, output):
     rulesCheck.snippets = rules.snippets
     rulesCheck.combine()
 
-    # The order of rules might be different
+    # The comparsion is not that simple. The order of rules might be
+    # different.
 #     if rules.rules != rulesCheck.rules:
 #         sys.stderr.write("Consistency error:\n")
 #         diff = rules.rules.getDiff(rulesCheck.rules)
@@ -284,11 +285,12 @@ def splitRules(rulesFN, output):
 #         sys.exit(1)
 
     for snip in rules.snippets:
-        print snip.__class__
-#     f = None
-#     if output == "-": f = sys.stdout
-#     f.writelines(rules.rules)
-#     f.close()
+        print snip.name
+        f = None
+        if output == "-": f = sys.stdout
+        else: f = open(snip.name, "w+")
+        f.writelines(snip.asLinesList())
+        f.close()
 
 def buildAllRules():
     import rulesdef