Annotation of src/sys/arch/hpcarm/conf/Makefile.hpcarm, Revision 1.6.2.1
1.6.2.1 ! thorpej 1: # $NetBSD: Makefile.hpcarm,v 1.7 2001/10/26 06:45:36 jmc Exp $
1.1 ichiro 2:
3: # Makefile for NetBSD
4: #
5: # This makefile is constructed from a machine description:
6: # config machineid
7: # Most changes should be made in the machine description
8: # /sys/arch/hpcarm/conf/``machineid''
9: # after which you should do
10: # config machineid
11: # Machine generic makefile changes should be made in
12: # /sys/arch/hpcarm/conf/Makefile.hpcarm
13: # after which config should be rerun for all machines of that type.
1.6 thorpej 14:
15: MACHINE_ARCH=arm32
1.6.2.1 ! thorpej 16: USETOOLS?= no
1.5 thorpej 17:
18: .include <bsd.own.mk>
1.1 ichiro 19:
20: # DEBUG is set to -g if debugging.
21: # PROF is set to -pg if profiling.
22:
23: AR?= ar
24: AS?= as
25: CC?= cc
26: CPP?= cpp
27: LD?= ld
28: LORDER?=lorder
29: MKDEP?= mkdep
30: NM?= nm
31: RANLIB?=ranlib
32: SIZE?= size
33: STRIP?= strip
34: TSORT?= tsort -q
35:
36: COPTS?= -O2
37:
38: # source tree is located via $S relative to the compilation directory
39: .ifndef S
40: S!= cd ../../../..; pwd
41: .endif
42: HPCARM= $S/arch/hpcarm
43:
44: HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
45: INCLUDES= -I. -I$S/arch -I$S -nostdinc
1.2 mrg 46: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -Dhpcarm -Darm32
1.1 ichiro 47: CWARNFLAGS?= -Werror -Wall -Wcomment -Wpointer-arith
48: # XXX Delete -Wuninitialized for now, since the compiler doesn't
49: # XXX always get it right. --thorpej
50: CWARNFLAGS+= -Wno-uninitialized
51: .if (${HAVE_EGCS} != "")
52: CWARNFLAGS+= -Wno-main
53: .endif
54: CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
55: AFLAGS= -x assembler-with-cpp -D_LOCORE
1.4 toshii 56: LINKFLAGS= -Ttext C0040000 -e start
1.1 ichiro 57: STRIPFLAGS= -g
58:
59: %INCLUDES
60:
61: HOSTED_CC= ${CC}
62: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
63: HOSTED_CFLAGS= ${CFLAGS}
64:
65: ### find out what to use for libkern
66: KERN_AS= obj
67: .include "$S/lib/libkern/Makefile.inc"
68: .ifndef PROF
69: LIBKERN= ${KERNLIB}
70: .else
71: LIBKERN= ${KERNLIB_PROF}
72: .endif
73:
74: ### find out what to use for libcompat
75: .include "$S/compat/common/Makefile.inc"
76: .ifndef PROF
77: LIBCOMPAT= ${COMPATLIB}
78: .else
79: LIBCOMPAT= ${COMPATLIB_PROF}
80: .endif
81:
82: # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
83: # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
84:
85: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
86: NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
87: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
88:
89: HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
90:
91: %OBJS
92:
93: %CFILES
94:
95: %SFILES
96:
97: # load lines for config "xxx" will be emitted as:
98: # xxx: ${SYSTEM_DEP} swapxxx.o
99: # ${SYSTEM_LD_HEAD}
100: # ${SYSTEM_LD} swapxxx.o
101: # ${SYSTEM_LD_TAIL}
102: SYSTEM_OBJ= locore.o \
103: param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
104: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
105: SYSTEM_LD_HEAD= rm -f $@
106: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
107: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
108: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
109:
110: DEBUG?=
111: .if ${DEBUG} == "-g"
112: LINKFLAGS+= -X
113: SYSTEM_LD_TAIL+=; \
114: echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
115: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
116: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
117: .else
118: #LINKFLAGS+= -S
1.3 toshii 119: LINKFLAGS+= -X
1.1 ichiro 120: .endif
121:
122: %LOAD
123:
124: assym.h: $S/kern/genassym.sh ${HPCARM}/hpcarm/genassym.cf
125: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
126: < ${HPCARM}/hpcarm/genassym.cf > assym.h.tmp && \
127: mv -f assym.h.tmp assym.h
128:
129: param.c: $S/conf/param.c
130: rm -f param.c
131: cp $S/conf/param.c .
132:
133: param.o: param.c Makefile
134: ${NORMAL_C}
135:
136: ioconf.o: ioconf.c
137: ${NORMAL_C}
138:
139: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
140: sh $S/conf/newvers.sh
141: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
142:
143: __CLEANKERNEL: .USE
144: @echo "${.TARGET}ing the kernel objects"
145: rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
146: [Ee]rrs linterrs makelinks assym.h.tmp assym.h modedefs.c
147:
148: __CLEANDEPEND: .USE
149: rm -f .depend
150:
151: clean: __CLEANKERNEL
152:
153: cleandir distclean: __CLEANKERNEL __CLEANDEPEND
154:
155: lint:
156: @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
157: ${HPCARM}/hpcarm/Locore.c ${CFILES} \
158: ioconf.c param.c | \
159: grep -v 'static function .* unused'
160:
161: tags:
162: @echo "see $S/kern/Makefile for tags"
163:
164: links:
165: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
166: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
167: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
168: sort -u | comm -23 - dontlink | \
169: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
170: sh makelinks && rm -f dontlink
171:
172: SRCS= ${HPCARM}/hpcarm/locore.S param.c ioconf.c ${CFILES} ${SFILES}
173: depend: .depend
174: .depend: ${SRCS} assym.h param.c
175: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${HPCARM}/hpcarm/locore.S
176: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
177: test -z "${SFILES}" || ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
178: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
179: ${CPPFLAGS} < ${HPCARM}/hpcarm/genassym.cf
180: @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
181: @rm -f assym.dep
182:
183: dependall: depend all
184:
185:
186: # depend on root or device configuration
187: autoconf.o conf.o: Makefile
188:
189: # depend on network
190: uipc_proto.o: Makefile
191:
192: # depend on maxusers
193: assym.h: Makefile
194:
195: # depend on CPU configuration
196: cpufunc.o cpufunc_asm.o: Makefile
197:
198: # depend on DIAGNOSTIC etc.
199: cpuswitch.o fault.o machdep.o: Makefile
200:
201:
202: locore.o: ${HPCARM}/hpcarm/locore.S assym.h
203: ${NORMAL_S}
204:
205: # The install target can be redefined by putting a
206: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
207: MACHINE_NAME!= uname -n
208: install: install-kernel-${MACHINE_NAME}
209: .if !target(install-kernel-${MACHINE_NAME}})
210: install-kernel-${MACHINE_NAME}:
211: rm -f /onetbsd
212: ln /netbsd /onetbsd
213: cp netbsd /nnetbsd
214: mv /nnetbsd /netbsd
215: .endif
216:
217: %RULES
CVSweb <webmaster@jp.NetBSD.org>