Annotation of sys/arch/hp300/conf/Makefile.hp300, Revision 1.1.1.1
1.1 nbrk 1: # $OpenBSD: Makefile.hp300,v 1.40 2007/07/30 16:23:33 thib Exp $
2: # $NetBSD: Makefile.hp300,v 1.54 1997/04/01 23:16:41 scottr Exp $
3:
4: # Makefile for OpenBSD
5: #
6: # This makefile is constructed from a machine description:
7: # config machineid
8: # Most changes should be made in the machine description
9: # /sys/arch/hp300/conf/``machineid''
10: # after which you should do
11: # config machineid
12: # Machine generic makefile changes should be made in
13: # /sys/arch/hp300/conf/Makefile.hp300
14: # after which config should be rerun for all machines of that type.
15: #
16: # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
17: # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
18: #
19: # -DTRACE compile in kernel tracing hooks
20: # -DQUOTA compile in file system quotas
21:
22: # DEBUG is set to -g if debugging.
23: # PROF is set to -pg if profiling.
24:
25: .include <bsd.own.mk>
26:
27: MKDEP?= mkdep
28: SIZE?= size
29: STRIP?= strip
30:
31: # source tree is located via $S relative to the compilation directory
32: .ifndef S
33: S!= cd ../../../..; pwd
34: .endif
35: HP300= $S/arch/hp300
36: M68K= $S/arch/m68k
37:
38: INCLUDES= -I. -I$S -I$S/arch -nostdinc
39: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
40: -Dmc68020 -Dhp300
41: CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
42: -Wno-uninitialized -Wno-format -Wno-main \
43: -Wstack-larger-than-2047
44: CMACHFLAGS= -msoft-float -fno-builtin-printf -fno-builtin-log
45: .if ${IDENT:M-DNO_PROPOLICE}
46: CMACHFLAGS+= -fno-stack-protector
47: .endif
48: COPTS?= -O2
49: CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} ${CMACHFLAGS} ${PIPE}
50: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
51: LINKFLAGS= -n -Ttext 0 -e start
52: STRIPFLAGS= -d
53:
54: HOSTCC?= ${CC}
55: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
56: HOSTED_CFLAGS= ${CFLAGS}
57:
58: ### CPU and MMU configuration
59:
60: .if (${IDENT:M-DHP320} != "" || ${IDENT:M-DHP350} != "")
61: _OPTIONS+= -DM68020 -DM68K_MMU_HP
62: CPPFLAGS+= -DCACHE_HAVE_VAC
63: .endif
64: .if (${IDENT:M-DHP330} != "")
65: _OPTIONS+= -DM68020 -DM68K_MMU_MOTOROLA
66: .endif
67: .if (${IDENT:M-DHP340} != "" || ${IDENT:M-DHP360} != "" || \
68: ${IDENT:M-DHP362} != "")
69: _OPTIONS+= -DM68030 -DM68K_MMU_MOTOROLA
70: .endif
71: .if (${IDENT:M-DHP345} != "" || ${IDENT:M-DHP370} != "" || \
72: ${IDENT:M-DHP375} != "" || ${IDENT:M-DHP400} != "")
73: _OPTIONS+= -DM68030 -DM68K_MMU_MOTOROLA
74: CPPFLAGS+= -DCACHE_HAVE_PAC
75: .endif
76: .if (${IDENT:M-DHP380} != "" || ${IDENT:M-DHP382} != "" || \
77: ${IDENT:M-DHP385} != "" || ${IDENT:M-DHP425} != "" || \
78: ${IDENT:M-DHP433} != "")
79: _OPTIONS+= -DM68K_MMU_MOTOROLA
80: CPPFLAGS+= -DM68040 -DFPSP
81: .endif
82: .if ${_OPTIONS:M-DM68020} != ""
83: CPPFLAGS+= -DM68020
84: .endif
85: .if ${_OPTIONS:M-DM68030} != ""
86: CPPFLAGS+= -DM68030
87: .endif
88: .if ${_OPTIONS:M-DM68K_MMU_HP} != ""
89: CPPFLAGS+= -DM68K_MMU_HP
90: .endif
91: .if ${_OPTIONS:M-DM68K_MMU_MOTOROLA} != ""
92: CPPFLAGS+= -DM68K_MMU_MOTOROLA
93: .endif
94:
95: ### find out what to use for libkern
96: .include "$S/lib/libkern/Makefile.inc"
97: .ifndef PROF
98: LIBKERN= ${KERNLIB}
99: .else
100: LIBKERN= ${KERNLIB_PROF}
101: .endif
102:
103: ### find out what to use for libcompat
104: .include "$S/compat/common/Makefile.inc"
105: .ifndef PROF
106: LIBCOMPAT= ${COMPATLIB}
107: .else
108: LIBCOMPAT= ${COMPATLIB_PROF}
109: .endif
110:
111: ### for the Motorola 68040 Floating Point Software Product
112: .include "${M68K}/fpsp/Makefile.inc"
113:
114: # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
115: # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
116:
117: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
118: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
119:
120: HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
121:
122: %OBJS
123:
124: %CFILES
125:
126: #%SFILES
127:
128: # load lines for config "xxx" will be emitted as:
129: # xxx: ${SYSTEM_DEP} swapxxx.o
130: # ${SYSTEM_LD_HEAD}
131: # ${SYSTEM_LD} swapxxx.o
132: # ${SYSTEM_LD_TAIL}
133: SYSTEM_OBJ= locore.o ${FPSP} \
134: param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
135: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
136: SYSTEM_LD_HEAD= @rm -f $@
137: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
138: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
139: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
140:
141: DEBUG?=
142: .if ${DEBUG} == "-g"
143: LINKFLAGS+= -X
144: SYSTEM_LD_TAIL+=; \
145: echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
146: echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
147: .else
148: LINKFLAGS+= -S
149: .endif
150:
151: %LOAD
152:
153: assym.h: $S/kern/genassym.sh \
154: ${M68K}/m68k/genassym.cf ${HP300}/hp300/genassym.cf Makefile
155: cat ${M68K}/m68k/genassym.cf ${HP300}/hp300/genassym.cf | \
156: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
157: > assym.h.tmp && \
158: mv -f assym.h.tmp assym.h
159:
160: param.c: $S/conf/param.c
161: rm -f param.c
162: cp $S/conf/param.c .
163:
164: param.o: param.c Makefile
165: ${NORMAL_C}
166:
167: ioconf.o: ioconf.c
168: ${NORMAL_C}
169:
170: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
171: sh $S/conf/newvers.sh
172: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
173:
174:
175: clean::
176: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
177: [Ee]rrs linterrs makelinks assym.h
178:
179: lint:
180: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
181: ${CFILES} ioconf.c param.c | \
182: grep -v 'static function .* unused'
183:
184: tags:
185: @echo "see $S/kern/Makefile for tags"
186:
187: links:
188: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
189: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
190: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
191: sort -u | comm -23 - dontlink | \
192: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
193: sh makelinks && rm -f dontlink
194:
195: SRCS= ${HP300}/hp300/locore.s \
196: param.c ioconf.c ${CFILES} ${SFILES}
197: depend:: .depend
198: .depend: ${SRCS} assym.h param.c
199: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${HP300}/hp300/locore.s
200: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
201: -if test -n "${SFILES}"; then \
202: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}; \
203: fi
204: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
205: ${CPPFLAGS} < ${HP300}/hp300/genassym.cf
206: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
207: @rm -f assym.dep
208:
209: # depend on root or device configuration
210: autoconf.o conf.o: Makefile
211:
212: # depend on network or filesystem configuration
213: uipc_proto.o vfs_conf.o: Makefile
214:
215: # depend on maxusers
216: assym.h machdep.o: Makefile
217:
218: # depend on CPU configuration
219: dma.o hpux_machdep.o locore.o machdep.o pmap.o pmap_boostrap.o sys_machdep.o trap.o: Makefile
220:
221:
222: locore.o: ${HP300}/hp300/locore.s assym.h
223: ${NORMAL_S}
224:
225: # The install target can be redefined by putting a
226: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
227: MACHINE_NAME!= uname -n
228: install: install-kernel-${MACHINE_NAME}
229: .if !target(install-kernel-${MACHINE_NAME}})
230: install-kernel-${MACHINE_NAME}:
231: rm -f /obsd
232: ln /bsd /obsd
233: cp bsd /nbsd
234: mv /nbsd /bsd
235: .endif
236:
237: %RULES
CVSweb