Annotation of src/sys/arch/i386/conf/Makefile.i386, Revision 1.89
1.89 ! mrg 1: # $NetBSD: Makefile.i386,v 1.88 1997/11/12 23:12:09 thorpej Exp $
1.62 mycroft 2:
1.8 cgd 3: # Makefile for NetBSD
1.1 cgd 4: #
5: # This makefile is constructed from a machine description:
6: # config machineid
7: # Most changes should be made in the machine description
1.36 deraadt 8: # /sys/arch/i386/conf/``machineid''
1.1 cgd 9: # after which you should do
1.62 mycroft 10: # config machineid
11: # Machine generic makefile changes should be made in
1.36 deraadt 12: # /sys/arch/i386/conf/Makefile.i386
1.42 mycroft 13: # after which config should be rerun for all machines of that type.
1.1 cgd 14: #
1.42 mycroft 15: # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
1.1 cgd 16: # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
17: #
18: # -DTRACE compile in kernel tracing hooks
19: # -DQUOTA compile in file system quotas
1.42 mycroft 20:
1.62 mycroft 21: # DEBUG is set to -g if debugging.
22: # PROF is set to -pg if profiling.
23:
1.88 thorpej 24: AR?= ar
25: AS?= as
1.65 mycroft 26: CC?= cc
1.88 thorpej 27: CPP?= cpp
1.65 mycroft 28: LD?= ld
1.87 thorpej 29: LORDER?=lorder
1.68 mycroft 30: MKDEP?= mkdep
1.87 thorpej 31: NM?= nm
1.88 thorpej 32: RANLIB?=ranlib
1.85 lukem 33: SIZE?= size
1.74 mycroft 34: STRIP?= strip
1.87 thorpej 35: TSORT?= tsort -q
1.88 thorpej 36:
1.85 lukem 37: COPTS?= -O2
1.1 cgd 38:
1.42 mycroft 39: # source tree is located via $S relative to the compilation directory
1.73 mycroft 40: .ifndef S
1.68 mycroft 41: S!= cd ../../../..; pwd
1.73 mycroft 42: .endif
1.68 mycroft 43: I386= $S/arch/i386
1.1 cgd 44:
1.69 mycroft 45: INCLUDES= -I. -I$S/arch -I$S -nostdinc
1.71 mycroft 46: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
47: -Di386
1.76 christos 48: CWARNFLAGS= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes
1.77 jonathan 49: CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
1.64 mycroft 50: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
1.86 fvdl 51: LINKFLAGS= -z -Ttext F0100000 -e start
1.74 mycroft 52: STRIPFLAGS= -d
53:
1.33 cgd 54: ### find out what to use for libkern
55: .include "$S/lib/libkern/Makefile.inc"
56: .ifndef PROF
57: LIBKERN= ${KERNLIB}
58: .else
59: LIBKERN= ${KERNLIB_PROF}
60: .endif
61:
1.56 christos 62: ### find out what to use for libcompat
63: .include "$S/compat/common/Makefile.inc"
64: .ifndef PROF
65: LIBCOMPAT= ${COMPATLIB}
66: .else
67: LIBCOMPAT= ${COMPATLIB_PROF}
68: .endif
69:
1.71 mycroft 70: # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
71: # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
1.42 mycroft 72:
1.62 mycroft 73: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
1.64 mycroft 74: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
1.42 mycroft 75:
1.1 cgd 76: %OBJS
77:
78: %CFILES
79:
1.62 mycroft 80: %SFILES
81:
1.42 mycroft 82: # load lines for config "xxx" will be emitted as:
83: # xxx: ${SYSTEM_DEP} swapxxx.o
84: # ${SYSTEM_LD_HEAD}
85: # ${SYSTEM_LD} swapxxx.o
86: # ${SYSTEM_LD_TAIL}
1.62 mycroft 87: SYSTEM_OBJ= locore.o \
1.66 cgd 88: param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
1.42 mycroft 89: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
90: SYSTEM_LD_HEAD= rm -f $@
1.62 mycroft 91: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
92: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
1.85 lukem 93: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
1.62 mycroft 94:
95: DEBUG?=
96: .if ${DEBUG} == "-g"
97: LINKFLAGS+= -X
98: SYSTEM_LD_TAIL+=; \
99: echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
1.74 mycroft 100: echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
1.62 mycroft 101: .else
1.89 ! mrg 102: LINKFLAGS+= -X
1.62 mycroft 103: .endif
1.42 mycroft 104:
1.1 cgd 105: %LOAD
1.50 mycroft 106:
1.82 mycroft 107: assym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf
108: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
109: < ${I386}/i386/genassym.cf > assym.h.tmp && \
110: mv -f assym.h.tmp assym.h
1.1 cgd 111:
1.62 mycroft 112: param.c: $S/conf/param.c
113: rm -f param.c
114: cp $S/conf/param.c .
1.1 cgd 115:
1.62 mycroft 116: param.o: param.c Makefile
1.71 mycroft 117: ${NORMAL_C}
1.1 cgd 118:
1.62 mycroft 119: ioconf.o: ioconf.c
120: ${NORMAL_C}
1.42 mycroft 121:
1.62 mycroft 122: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
123: sh $S/conf/newvers.sh
124: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1.1 cgd 125:
126:
1.84 christos 127: __CLEANKERNEL: .USE
128: @echo "${.TARGET}ing the kernel objects"
1.66 cgd 129: rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1.82 mycroft 130: [Ee]rrs linterrs makelinks assym.h.tmp assym.h
1.84 christos 131:
132: __CLEANDEPEND: .USE
133: rm -f .depend
134:
135: clean: __CLEANKERNEL
136:
137: cleandir: __CLEANKERNEL __CLEANDEPEND
1.1 cgd 138:
1.62 mycroft 139: lint:
1.79 perry 140: @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
1.80 perry 141: ${I386}/i386/Locore.c ${CFILES} \
1.62 mycroft 142: ioconf.c param.c | \
143: grep -v 'static function .* unused'
1.1 cgd 144:
1.62 mycroft 145: tags:
146: @echo "see $S/kern/Makefile for tags"
1.1 cgd 147:
148: links:
149: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
150: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
151: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
152: sort -u | comm -23 - dontlink | \
1.62 mycroft 153: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1.1 cgd 154: sh makelinks && rm -f dontlink
155:
1.62 mycroft 156: SRCS= ${I386}/i386/locore.s \
1.66 cgd 157: param.c ioconf.c ${CFILES} ${SFILES}
1.78 cgd 158: depend: .depend
1.75 jtk 159: .depend: ${SRCS} assym.h param.c
1.68 mycroft 160: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
161: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
162: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1.83 leo 163: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
164: ${CPPFLAGS} < ${I386}/i386/genassym.cf
165: @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
166: @rm -f assym.dep
1.62 mycroft 167:
168:
169: # depend on root or device configuration
170: autoconf.o conf.o: Makefile
171:
172: # depend on network or filesystem configuration
173: uipc_proto.o vfs_conf.o: Makefile
1.1 cgd 174:
1.62 mycroft 175: # depend on maxusers
1.82 mycroft 176: machdep.o: Makefile
1.1 cgd 177:
1.62 mycroft 178: # depend on CPU configuration
179: locore.o machdep.o: Makefile
1.1 cgd 180:
1.2 cgd 181:
1.62 mycroft 182: locore.o: ${I386}/i386/locore.s assym.h
183: ${NORMAL_S}
1.1 cgd 184:
185: %RULES
CVSweb <webmaster@jp.NetBSD.org>