From cbd0823fde1b3feb4cfa9ef3a5affca5a4554d5e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Jan 2010 00:36:55 +0000 Subject: Updated the general rules to use the new regex function, they're safer now, and everything works. Unfortunately, with this release, you'll have to rebuild with the shell script... --- share/autoinclude/general-rules.bld | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'share/autoinclude/general-rules.bld') diff --git a/share/autoinclude/general-rules.bld b/share/autoinclude/general-rules.bld index 9f905a6..94b06eb 100644 --- a/share/autoinclude/general-rules.bld +++ b/share/autoinclude/general-rules.bld @@ -40,7 +40,7 @@ function cppToObj() DIR = OBJ_DIR; } - return DIR + "/" + INPUT.fileName().replace(".cpp", ".o"); + return DIR + "/" + INPUT.fileName().regex("\\.cpp$", ".o"); } function cToObj() @@ -54,7 +54,7 @@ function cToObj() DIR = OBJ_DIR; } - return DIR + "/" + INPUT.fileName().replace(".c", ".o"); + return DIR + "/" + INPUT.fileName().regex("\\.c$", ".o"); } rule "exe" @@ -100,7 +100,6 @@ rule "c" { input "*.c"; output INPUT.cToObj(); -// output replace(".c", ".o"); requires getMakeDeps("${CC} ${CFLAGS} -M ${INPUT}"); profile "build" { @@ -111,10 +110,10 @@ rule "c" rule "bison" { input "*.y"; - output [INPUT.replace(".y", ".tab.c"), INPUT.replace(".y", ".tab.h")]; + output [INPUT.regex("\\.y$", ".tab.c"), INPUT.regex("\\.y$", ".tab.h")]; profile "build" { - BASE = INPUT.replace(".y", ""); + BASE = INPUT.regex("\\.y", ""); execute("${BISON} -b${BASE} ${INPUT}"); // if you add a -v bison will produce a .output file } @@ -123,8 +122,8 @@ rule "bison" rule "flex" { input "*.l"; - output INPUT.replace(".l", ".yy.c"); - output INPUT.replace(".l", ".yy.h"); + output INPUT.regex("\\.l$", ".yy.c"); + output INPUT.regex("\\.l$", ".yy.h"); profile "build" { execute("${FLEX} ${FLEXFLAGS} ${INPUT}"); -- cgit v1.2.3