From d71d3ede34f22c52442ad7c9a35cba88d3660c15 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 25 Jan 2010 02:35:28 +0000 Subject: Corrected the rules to not assume that files are in a subdirectory, the code makes a little more sense now as well. --- share/autoinclude/general-rules.bld | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'share/autoinclude') diff --git a/share/autoinclude/general-rules.bld b/share/autoinclude/general-rules.bld index 94b06eb..0b8f6e3 100644 --- a/share/autoinclude/general-rules.bld +++ b/share/autoinclude/general-rules.bld @@ -33,28 +33,26 @@ function cppToObj() { if OBJ_DIR == null then { - DIR = INPUT.dirName(); + return INPUT.regex("\\.cpp$", ".o"); } else { - DIR = OBJ_DIR; + return OBJ_DIR + "/" + INPUT.fileName().regex("\\.cpp$", ".o"); } - return DIR + "/" + INPUT.fileName().regex("\\.cpp$", ".o"); } function cToObj() { if OBJ_DIR == null then { - DIR = INPUT.dirName(); + return INPUT.regex("\\.c$", ".o"); } else { - DIR = OBJ_DIR; + return OBJ_DIR + "/" + INPUT.fileName().regex("\\.c$", ".o"); } - return DIR + "/" + INPUT.fileName().regex("\\.c$", ".o"); } rule "exe" -- cgit v1.2.3