clean up a bit after jason :)
- fix emitrules() like emitfiles() to deal with the prefix (otherwise it would attempt to find the file in the normal base for the NORMAL_C rule). - add emitincludes() which adds include directives for each prefix to the $INCLUDES variable in the makefile. - add %INCLUDES to each Makefile.arch to deal with the above. this makes "prefix" actually work in a usable manner, and now i can move on to fixing compiler warnings (errors) in the ESP code. :)
This commit is contained in:
parent
61abb01179
commit
ecdad0ec33
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.alpha,v 1.51 1999/05/31 18:54:49 ross Exp $
|
||||
# $NetBSD: Makefile.alpha,v 1.52 1999/07/09 09:52:55 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -55,6 +55,8 @@ LOADADDRESS?= fffffc0000300000
|
||||
LINKFLAGS= -N -Ttext ${LOADADDRESS} -e __transfer -G 4
|
||||
STRIPFLAGS= -g -X
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.amiga,v 1.80 1999/01/15 23:37:05 thorpej Exp $
|
||||
# $NetBSD: Makefile.amiga,v 1.81 1999/07/09 09:52:55 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -60,6 +60,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 0 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.arm32,v 1.45 1999/01/29 22:20:49 tron Exp $
|
||||
# $NetBSD: Makefile.arm32,v 1.46 1999/07/09 09:52:56 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -54,6 +54,8 @@ AFLAGS= -x assembler-with-cpp -D_LOCORE
|
||||
LINKFLAGS= -Ttext F0000000 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.atari,v 1.52 1999/05/06 20:25:17 leo Exp $
|
||||
# $NetBSD: Makefile.atari,v 1.53 1999/07/09 09:52:56 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -60,6 +60,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 0 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.bebox,v 1.12 1999/06/24 01:19:51 sakamoto Exp $
|
||||
# $NetBSD: Makefile.bebox,v 1.13 1999/07/09 09:52:56 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -57,6 +57,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 0x3100 -e __start
|
||||
STRIPFLAGS= --strip-debug
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.hp300,v 1.68 1999/01/15 23:37:06 thorpej Exp $
|
||||
# $NetBSD: Makefile.hp300,v 1.69 1999/07/09 09:52:57 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -55,6 +55,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 0 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.i386,v 1.97 1999/01/28 20:04:54 christos Exp $
|
||||
# $NetBSD: Makefile.i386,v 1.98 1999/07/09 09:52:57 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -62,6 +62,8 @@ LINKFLAGS+= -z
|
||||
.endif
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.mac68k,v 1.68 1999/01/15 23:37:06 thorpej Exp $
|
||||
# $NetBSD: Makefile.mac68k,v 1.69 1999/07/09 09:52:57 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -55,6 +55,8 @@ AFLAGS= -traditional -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 0 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### Find out what to use for libkern.
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.macppc,v 1.6 1999/01/15 23:37:06 thorpej Exp $
|
||||
# $NetBSD: Makefile.macppc,v 1.7 1999/07/09 09:52:57 mrg Exp $
|
||||
#
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -56,6 +56,8 @@ AFLAGS= -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 100000 -e __start
|
||||
STRIPFLAGS= --strip-debug
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.mvme68k,v 1.39 1999/01/15 23:37:06 thorpej Exp $
|
||||
# $NetBSD: Makefile.mvme68k,v 1.40 1999/07/09 09:52:58 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -56,6 +56,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 8000 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.newsmips,v 1.17 1999/07/08 11:53:35 tsubai Exp $
|
||||
# $NetBSD: Makefile.newsmips,v 1.18 1999/07/09 09:52:58 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -58,6 +58,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 80001000 -e start ${GP} -T ../../conf/kern.ldscript
|
||||
STRIPFLAGS= -g -X -x
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.next68k,v 1.7 1999/01/15 23:21:26 thorpej Exp $
|
||||
# $NetBSD: Makefile.next68k,v 1.8 1999/07/09 09:52:59 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -67,6 +67,8 @@ STRIPFLAGS?= -d
|
||||
# -S is used in gnu strip, rather than -d:
|
||||
#STRIPFLAGS= -S
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### Find out what to use for libkern.
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.ofppc,v 1.18 1999/01/15 23:37:07 thorpej Exp $
|
||||
# $NetBSD: Makefile.ofppc,v 1.19 1999/07/09 09:52:59 mrg Exp $
|
||||
#
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -57,6 +57,8 @@ AFLAGS= -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 100000 -e __start
|
||||
STRIPFLAGS= --strip-debug
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.pc532,v 1.54 1999/03/14 05:03:35 jonb Exp $
|
||||
# $NetBSD: Makefile.pc532,v 1.55 1999/07/09 09:52:59 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -55,6 +55,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -z -Ttext F8002000 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.pica,v 1.25 1999/01/15 23:37:07 thorpej Exp $
|
||||
# $NetBSD: Makefile.pica,v 1.26 1999/07/09 09:52:59 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -58,6 +58,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -T${MIPS}/conf/kern.ldscript -Ttext 80080000 -e start ${GP}
|
||||
STRIPFLAGS= -g -X -x
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.pmax,v 1.73 1999/07/02 20:55:19 tv Exp $
|
||||
# $NetBSD: Makefile.pmax,v 1.74 1999/07/09 09:53:00 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -59,6 +59,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -Ttext 0x80030000 -T ${MIPS}/conf/kern.ldscript -e start ${GP}
|
||||
STRIPFLAGS= -g -X -x
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.sparc,v 1.60 1999/06/28 21:03:23 pk Exp $
|
||||
# $NetBSD: Makefile.sparc,v 1.61 1999/07/09 09:53:00 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -64,6 +64,8 @@ LINKFLAGS+= -n
|
||||
.endif
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.sparc64,v 1.9 1999/06/05 01:56:31 mrg Exp $
|
||||
# $NetBSD: Makefile.sparc64,v 1.10 1999/07/09 09:53:00 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -67,6 +67,8 @@ AFLAGS= -x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -p -Ttext f8000000 -e start >lderr
|
||||
#STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.sun3,v 1.74 1999/01/15 23:21:27 thorpej Exp $
|
||||
# $NetBSD: Makefile.sun3,v 1.75 1999/07/09 09:53:00 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -72,6 +72,8 @@ AFLAGS=
|
||||
LINKFLAGS= -N -Ttext ${TEXTADDR} -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.vax,v 1.47 1999/01/17 19:09:00 matt Exp $
|
||||
# $NetBSD: Makefile.vax,v 1.48 1999/07/09 09:53:01 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -59,6 +59,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 80000000 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.x68k,v 1.35 1999/04/01 14:11:21 minoura Exp $
|
||||
# $NetBSD: Makefile.x68k,v 1.36 1999/07/09 09:53:01 mrg Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -62,6 +62,8 @@ AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -n -Ttext 0 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: config.h,v 1.44 1999/07/09 06:44:58 thorpej Exp $ */
|
||||
/* $NetBSD: config.h,v 1.45 1999/07/09 09:53:01 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -348,6 +348,7 @@ struct files *allfiles; /* list of all kernel source files */
|
||||
struct objects *allobjects; /* list of all kernel object and library
|
||||
files */
|
||||
struct prefix *prefixes; /* prefix stack */
|
||||
struct prefix *allprefixes; /* all prefixes used (after popped) */
|
||||
|
||||
struct devi **packed; /* arrayified table for packed devi's */
|
||||
int npacked; /* size of packed table, <= ndevi */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mkmakefile.c,v 1.40 1999/07/09 06:44:59 thorpej Exp $ */
|
||||
/* $NetBSD: mkmakefile.c,v 1.41 1999/07/09 09:53:01 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -67,6 +67,7 @@ static int emitcfiles __P((FILE *));
|
||||
static int emitsfiles __P((FILE *));
|
||||
static int emitrules __P((FILE *));
|
||||
static int emitload __P((FILE *));
|
||||
static int emitincludes __P((FILE *));
|
||||
|
||||
int
|
||||
mkmakefile()
|
||||
@ -111,6 +112,8 @@ mkmakefile()
|
||||
fn = emitrules;
|
||||
else if (strcmp(line, "%LOAD\n") == 0)
|
||||
fn = emitload;
|
||||
else if (strcmp(line, "%INCLUDES\n") == 0)
|
||||
fn = emitincludes;
|
||||
else {
|
||||
xerror(ifname, lineno,
|
||||
"unknown %% construct ignored: %s", line);
|
||||
@ -388,9 +391,20 @@ emitrules(fp)
|
||||
continue;
|
||||
if ((fpath = srcpath(fi)) == NULL)
|
||||
return (1);
|
||||
if (fprintf(fp, "%s.o: %s%s\n", fi->fi_base,
|
||||
*fpath != '/' ? "$S/" : "", fpath) < 0)
|
||||
return (1);
|
||||
if (*fpath == '/') {
|
||||
if (fprintf(fp, "%s.o: %s\n", fi->fi_base, fpath) < 0)
|
||||
return (1);
|
||||
} else {
|
||||
if (fi->fi_prefix != NULL) {
|
||||
if (fprintf(fp, "%s.o: $S/%s/%s\n", fi->fi_base,
|
||||
fi->fi_prefix, fpath) < 0)
|
||||
return (1);
|
||||
} else {
|
||||
if (fprintf(fp, "%s.o: $S/%s\n", fi->fi_base,
|
||||
fpath) < 0)
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
if ((cp = fi->fi_mkrule) == NULL) {
|
||||
cp = "NORMAL";
|
||||
ch = fpath[strlen(fpath) - 1];
|
||||
@ -452,3 +466,25 @@ swap%s.o: ", swname, swname) < 0)
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Emit include headers (for any prefixes encountered)
|
||||
*/
|
||||
static int
|
||||
emitincludes(fp)
|
||||
FILE *fp;
|
||||
{
|
||||
struct prefix *pf;
|
||||
int done = 0;
|
||||
|
||||
for (pf = allprefixes; pf != NULL; pf = pf->pf_next) {
|
||||
if (done == 0) {
|
||||
done = 1;
|
||||
fprintf(fp, "INCLUDES+=\t");
|
||||
}
|
||||
fprintf(fp, " -I$S/%s", pf->pf_prefix);
|
||||
}
|
||||
putc('\n', fp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: util.c,v 1.8 1999/07/09 06:44:59 thorpej Exp $ */
|
||||
/* $NetBSD: util.c,v 1.9 1999/07/09 09:53:01 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -151,7 +151,17 @@ prefix_pop()
|
||||
}
|
||||
|
||||
prefixes = pf->pf_next;
|
||||
free(pf);
|
||||
|
||||
/*
|
||||
* Once we're done with it, put it on the allprefixes list.
|
||||
*/
|
||||
if (allprefixes) {
|
||||
allprefixes = pf;
|
||||
pf->pf_next = NULL;
|
||||
} else {
|
||||
pf->pf_next = allprefixes;
|
||||
allprefixes = pf;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user