At approx. line 685 of config/gen/makefiles/root.in, we have this suffix rule:

# constant string support
.c.str : # suffix rule (limited support)
    $(PERL) $(BUILD_TOOLS_DIR)/c2str.pl $< > $@

According to http://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html#Suffix-Rules (patspam++ for the link; not_gerd++ for #parrot discussion), "[S]uffix rules are the old-fashioned way of defining implicit rules for make. Suffix rules are obsolete because pattern rules are more general and clearer."

Should we change this suffix rule to be a pattern rule? (http://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html#Pattern-Intro)

In the 'implicit_c2str' branch on github, I have modified this suffix rule to be a pattern rule. (See patch attached.)

Would this be a problem for versions of 'make' other than GNU's?

Thank you very much.
Jim Keenan
(#parrot kid51)

>From 9c713a432265536cfe2f18e91211e673bc248c31 Mon Sep 17 00:00:00 2001
From: jkeenan <[email protected]>
Date: Fri, 15 Jun 2012 15:08:58 -0400
Subject: [PATCH] Change the suffix rule for c2str to be a pattern rule.

---
 config/gen/makefiles/root.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in
index a52d766..5f5ef31 100644
--- a/config/gen/makefiles/root.in
+++ b/config/gen/makefiles/root.in
@@ -680,8 +680,8 @@ $(LIBRARY_DIR)/Config/JSON.pbc: $(DYNEXT_DIR)/io_ops$(LOAD_EXT) $(DYNEXT_DIR)/sy
 
 $(LIBRARY_DIR)/LWP/UserAgent.pbc: $(DYNEXT_DIR)/io_ops$(LOAD_EXT)
 
-# constant string support
-.c.str : # suffix rule (limited support)
+# Implicit rule for creating .str files from .c source files
+%.str : %.c
 	$(PERL) $(BUILD_TOOLS_DIR)/c2str.pl $< > $@
 
 STR_FILES = \
-- 
1.5.6.5

_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to