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 Generate a makefile which is cross-...



details:   https://anonhg.NetBSD.org/src/rev/c7681c7a73c7
branches:  trunk
changeset: 472768:c7681c7a73c7
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Thu May 06 18:40:39 1999 +0000

description:
Generate a makefile which is cross-crunching compatabile:

1) Include bsd.sys.mk so we pick up DESTDIR changes to fine .h files.
2) Only set STRIP if it's unset.
3) Generate .cro files rather than .lo files. .lo now is used for "local
        objects" - obj's for the host machine not the target machine.

diffstat:

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

diffs (67 lines):

diff -r 5adfe323ad0c -r c7681c7a73c7 usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Thu May 06 17:13:08 1999 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Thu May 06 18:40:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.9 1998/09/13 05:32:18 wrstuden Exp $   */
+/*     $NetBSD: crunchgen.c,v 1.10 1999/05/06 18:40:39 wrstuden 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.9 1998/09/13 05:32:18 wrstuden Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.10 1999/05/06 18:40:39 wrstuden Exp $");
 #endif
 
 #include <stdlib.h>
@@ -682,6 +682,7 @@
     for(p = progs; p != NULL; p = p->next)
        prog_makefile_rules(outmk, p); 
 
+    fprintf(outmk, "\n.include <bsd.sys.mk>\n");
     fprintf(outmk, "\n# ========\n");
     fclose(outmk);
 }
@@ -768,14 +769,14 @@
 {
     prog_t *p;
 
-    fprintf(outmk, "STRIP=strip\n");
+    fprintf(outmk, "STRIP?=strip\n");
     fprintf(outmk, "LIBS=");
     fprintf(outmk, "-L%s ", libdir);
     output_strlst(outmk, libs);
 
     fprintf(outmk, "CRUNCHED_OBJS=");
     for(p = progs; p != NULL; p = p->next)
-       fprintf(outmk, " %s.lo", p->name);
+       fprintf(outmk, " %s.cro", p->name);
     fprintf(outmk, "\n");
 
     fprintf(outmk, "SUBMAKE_TARGETS=");
@@ -790,7 +791,7 @@
     fprintf(outmk, "\t$(STRIP) %s\n", execfname);
     fprintf(outmk, "all: objs exe\nobjs: $(SUBMAKE_TARGETS)\n");
     fprintf(outmk, "exe: %s\n", execfname);
-    fprintf(outmk, "clean:\n\trm -f %s *.lo *.o *_stub.c\n",
+    fprintf(outmk, "clean:\n\trm -f %s *.cro *.o *_stub.c\n",
            execfname);
 }
 
@@ -819,11 +820,11 @@
                   "int _crunched_%s_stub(int argc, char **argv, char **envp)"
                   "{return main(argc,argv,envp);}\" >%s_stub.c\n",
            p->ident, p->name);
-    fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS)\n",
+    fprintf(outmk, "%s.cro: %s_stub.o $(%s_OBJPATHS)\n",
            p->name, p->name, p->ident);
-    fprintf(outmk, "\t${LD} -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)\n", 
+    fprintf(outmk, "\t${LD} -dc -r -o %s.cro %s_stub.o $(%s_OBJPATHS)\n", 
            p->name, p->name, p->ident);
-    fprintf(outmk, "\tcrunchide -k _crunched_%s_stub %s.lo\n", 
+    fprintf(outmk, "\tcrunchide -k _crunched_%s_stub %s.cro\n", 
            p->ident, p->name);
 }
 



Home | Main Index | Thread Index | Old Index