Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/crunch/crunchgen Changes to the emitted makefiles th...



details:   https://anonhg.NetBSD.org/src/rev/a2b100a6881a
branches:  trunk
changeset: 515402:a2b100a6881a
user:      tls <tls%NetBSD.org@localhost>
date:      Mon Sep 24 00:40:35 2001 +0000

description:
Changes to the emitted makefiles that actually build the objects:

1) Always do a make clean before building objects in any directory.  This
   is wasteful, but there's really no other simple way to cope with the
   fact that the compilation settings (e.g. CFLAGS) appropriate for the
   non-crunched build of a program may not be appropriate for the crunched
   build.  If the objdir magic in make didn't rely upon the presence of an
   "obj" or "obj.${MACHINE}" symlink, we could abuse it to handle this but
   unfortunately, it does.

2) Override $DBG to cause object files to be built with -Os.  We can't emit
   "DBG?=" into the generated makefile because of order-of-inclusion issues
   with the system Makefiles; the result would be that the default setting
   (currently -O2) would always be used instead of -Os.  If you're crunching,
   you almost certainly are doing it to get a smaller executable (!) so -Os
   is almost certainly appropriate for you.

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 055d40278761 -r a2b100a6881a usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Mon Sep 24 00:20:11 2001 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Mon Sep 24 00:40:35 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.20 2001/02/05 01:40:51 christos Exp $  */
+/*     $NetBSD: crunchgen.c,v 1.21 2001/09/24 00:40:35 tls Exp $       */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: crunchgen.c,v 1.20 2001/02/05 01:40:51 christos Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.21 2001/09/24 00:40:35 tls Exp $");
 #endif
 
 #include <stdlib.h>
@@ -789,6 +789,7 @@
 {
     prog_t *p;
 
+    fprintf(outmk, "DBG=-Os\n");
     fprintf(outmk, "STRIP?=strip\n");
     fprintf(outmk, "CRUNCHIDE?=crunchide\n");
     fprintf(outmk, "LIBS=");
@@ -826,8 +827,8 @@
        fprintf(outmk, "%s_OBJS=", p->ident);
        output_strlst(outmk, p->objs);
        fprintf(outmk, "%s_make:\n", p->ident);
-       fprintf(outmk, "\t(cd $(%s_SRCDIR); %s $(%s_OBJS))\n\n", 
-               p->ident, makebin, p->ident);
+       fprintf(outmk, "\t(cd $(%s_SRCDIR); %s clean ; %s DBG=${DBG} $(%s_OBJS))\n\n", 
+               p->ident, makebin, makebin, p->ident);
     }
     else
        fprintf(outmk, "%s_make:\n\t@echo \"** cannot make objs for %s\"\n\n", 



Home | Main Index | Thread Index | Old Index