From 61d11499a39005cea25b0d0b037b45d99501d4eb Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 27 Nov 2005 16:35:57 +0000 Subject: [PATCH] don't rewrite CPP_OPTION (pfile, obj_ext) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3994 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- support/cpp2/mkdeps.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/support/cpp2/mkdeps.c b/support/cpp2/mkdeps.c index b53c63a8..1cac9496 100644 --- a/support/cpp2/mkdeps.c +++ b/support/cpp2/mkdeps.c @@ -196,26 +196,28 @@ deps_add_default_target (pfile, tgt) char *start = lbasename (tgt); char *o; char *suffix; + const char *obj_ext; if (NULL == CPP_OPTION (pfile, obj_ext)) - CPP_OPTION (pfile, obj_ext) = TARGET_OBJECT_SUFFIX; + obj_ext = TARGET_OBJECT_SUFFIX; else if (CPP_OPTION (pfile, obj_ext)[0] != '.') { - char *t = (char *) alloca (strlen (CPP_OPTION (pfile, obj_ext)) + 2); + char *t = alloca (strlen (CPP_OPTION (pfile, obj_ext)) + 2); t[0] = '.'; strcpy (&t[1], CPP_OPTION (pfile, obj_ext)); - CPP_OPTION (pfile, obj_ext) = t; - printf("obj_ext = %s\n", CPP_OPTION (pfile, obj_ext)); + obj_ext = t; } + else + obj_ext = CPP_OPTION (pfile, obj_ext); - o = (char *) alloca (strlen (start) + strlen (CPP_OPTION (pfile, obj_ext)) + 1); + o = (char *) alloca (strlen (start) + strlen (obj_ext) + 1); strcpy (o, start); suffix = strrchr (o, '.'); if (!suffix) suffix = o + strlen (o); - strcpy (suffix, CPP_OPTION (pfile, obj_ext)); + strcpy (suffix, obj_ext); deps_add_target (pfile->deps, o, 1); } -- 2.47.2