Annotation of sys/arch/landisk/conf/Makefile.landisk, Revision 1.1.1.1
1.1 nbrk 1: # $OpenBSD: Makefile.landisk,v 1.4 2007/07/30 16:23:33 thib Exp $
2: #
3: # Makefile for OpenBSD/landisk
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/landisk/conf/``machineid''
9: # after which you should do
10: # config machineid
11: # Machine generic makefile changes should be made in
12: # /sys/arch/landisk/conf/Makefile.landisk
13: # after which config should be rerun for all machines of that type.
14: #
15: # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
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
20: #
21: .SUFFIXES: .S .c .o
22:
23: # DEBUG is set to -g if debugging.
24: # PROF is set to -pg if profiling.
25:
26: .include <bsd.own.mk>
27:
28: MKDEP?= mkdep
29: STRIP?= strip
30: SIZE?= size
31:
32: # source tree is located via $S relative to the compilation directory
33: .ifndef S
34: S!= cd ../../../..; pwd
35: .endif
36: LANDISK= $S/arch/landisk
37: SH= $S/arch/sh
38:
39: INCLUDES= -I. -I$S -I$S/arch -nostdinc
40: CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dlandisk
41: CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
42: -Wno-uninitialized -Wno-format -Wno-main \
43: -Wstack-larger-than-2047
44: CMACHFLAGS= -m4-nofpu \
45: -fno-builtin-printf -fno-builtin-log -fno-builtin-main
46: .if ${IDENT:M-DNO_PROPOLICE}
47: CMACHFLAGS+= -fno-stack-protector
48: .endif
49: COPTS?= -O2
50: CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
51: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -Wa,-little
52: LINKFLAGS= -N -Ttext 0x8c002000 -e start --warn-common
53: STRIPFLAGS= -g -X -x
54:
55: HOSTCC?= ${CC}
56: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
57: HOSTED_CFLAGS= ${CFLAGS}
58:
59: ### find out what to use for libkern
60: .include "$S/lib/libkern/Makefile.inc"
61: .ifndef PROF
62: LIBKERN= ${KERNLIB}
63: .else
64: LIBKERN= ${KERNLIB_PROF}
65: .endif
66:
67: ### find out what to use for libcompat
68: .include "$S/compat/common/Makefile.inc"
69: .ifndef PROF
70: LIBCOMPAT= ${COMPATLIB}
71: .else
72: LIBCOMPAT= ${COMPATLIB_PROF}
73: .endif
74:
75: # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
76: # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
77: # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
78: # is marked as config-dependent.
79:
80: USRLAND_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
81: USRLAND_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
82:
83: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
84: NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
85:
86: DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
87: DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
88:
89: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
90: NORMAL_S_C= ${AS} ${COPTS} ${PARAM} $< -o $@
91:
92:
93: %OBJS
94:
95: %CFILES
96:
97: %SFILES
98:
99: # load lines for config "xxx" will be emitted as:
100: # xxx: ${SYSTEM_DEP} swapxxx.o
101: # ${SYSTEM_LD_HEAD}
102: # ${SYSTEM_LD} swapxxx.o
103: # ${SYSTEM_LD_TAIL}
104: SYSTEM_OBJ= locore.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
105: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
106: SYSTEM_LD_HEAD= rm -f $@
107: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
108: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
109: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
110:
111: DEBUG?=
112: .if ${DEBUG} == "-g"
113: LINKFLAGS+= -X
114: SYSTEM_LD_TAIL+=; \
115: echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
116: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
117: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
118: .else
119: LINKFLAGS+= -S -x
120: .endif
121:
122: %LOAD
123:
124: assym.h: $S/kern/genassym.sh \
125: ${SH}/sh/genassym.cf Makefile
126: cat ${SH}/sh/genassym.cf | \
127: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
128: > assym.h.tmp && \
129: mv -f assym.h.tmp assym.h
130:
131: param.c: $S/conf/param.c
132: rm -f param.c
133: cp $S/conf/param.c .
134:
135: param.o: param.c Makefile
136: ${NORMAL_C_C}
137:
138: ioconf.o: ioconf.c
139: ${NORMAL_C}
140:
141: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
142: sh $S/conf/newvers.sh
143: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
144:
145: clean::
146: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
147: [Ee]rrs linterrs makelinks genassym genassym.o assym.h
148:
149: lint:
150: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB ${CFILES} \
151: ioconf.c param.c | \
152: grep -v 'static function .* unused'
153:
154: tags:
155: @echo "see $S/kern/Makefile for tags"
156:
157: links:
158: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
159: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
160: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
161: sort -u | comm -23 - dontlink | \
162: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
163: sh makelinks && rm -f dontlink
164:
165: SRCS= ${LANDISK}/landisk/locore.S \
166: param.c ioconf.c ${CFILES} ${SFILES}
167: depend:: .depend
168: .depend: ${SRCS} assym.h param.c
169: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${LANDISK}/landisk/locore.S
170: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
171: .if ${SFILES} != ""
172: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
173: .endif
174: cat ${SH}/sh/genassym.cf | \
175: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS}
176: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
177: @rm -f assym.dep
178:
179: # depend on root or device configuration
180: autoconf.o conf.o: Makefile
181:
182: # depend on network or filesystem configuration
183: uipc_proto.o vfs_conf.o: Makefile
184:
185: # depend on maxusers
186: assym.h machdep.o: Makefile
187:
188: # depend on CPU configuration
189: locore.o machdep.o: Makefile
190:
191:
192: locore.o: ${LANDISK}/landisk/locore.S assym.h
193: ${NORMAL_S}
194:
195: # The install target can be redefined by putting a
196: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
197: MACHINE_NAME!= uname -n
198: install: install-kernel-${MACHINE_NAME}
199: .if !target(install-kernel-${MACHINE_NAME}})
200: install-kernel-${MACHINE_NAME}:
201: rm -f /obsd
202: ln /bsd /obsd
203: cp bsd /nbsd
204: mv /nbsd /bsd
205: .endif
206:
207: %RULES
CVSweb