Annotation of sys/arch/amd64/conf/Makefile.amd64, Revision 1.1.1.1
1.1 nbrk 1: # $OpenBSD: Makefile.amd64,v 1.11 2007/07/27 13:39:00 deraadt Exp $
2:
3: # Makefile for OpenBSD
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/amd64/conf/``machineid''
9: # after which you should do
10: # config machineid
11: # Machine generic makefile changes should be made in
12: # /sys/arch/amd64/conf/Makefile.amd64
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: # DEBUG is set to -g if debugging.
22: # PROF is set to -pg if profiling.
23:
24: .include <bsd.own.mk>
25:
26: MKDEP?= mkdep
27: SIZE?= size
28: STRIP?= strip
29:
30: # source tree is located via $S relative to the compilation directory
31: .ifndef S
32: S!= cd ../../../..; pwd
33: .endif
34: AMD64= $S/arch/amd64
35:
36: INCLUDES= -nostdinc -I. -I$S -I$S/arch
37: CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Damd64 -Dx86_64
38: CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
39: -Wno-uninitialized -Wno-format -Wno-main -Wno-sign-compare \
40: -Wstack-larger-than-2047
41:
42: CMACHFLAGS+= -mcmodel=kernel -mno-red-zone -fno-strict-aliasing \
43: -mno-sse2 -mno-sse -mno-3dnow -mno-mmx -msoft-float \
44: -fno-builtin-printf -fno-builtin-log -fno-omit-frame-pointer
45: .if ${IDENT:M-DNO_PROPOLICE}
46: CMACHFLAGS+= -fno-stack-protector
47: .endif
48:
49: COPTS?= -O2
50: CFLAGS= ${DEBUG} ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
51: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
52: LINKFLAGS= -Ttext 0xffffffff801001e0 -e start -X
53: STRIPFLAGS= -g -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: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
81: NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
82:
83: DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
84: DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
85:
86: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
87: NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
88:
89: HOSTED_C= ${HOSTCC} ${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 vector.o copy.o spl.o \
103: param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
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 $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
115: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
116: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
117: .else
118: LINKFLAGS+= -S -x
119: .endif
120:
121: %LOAD
122:
123: assym.h: $S/kern/genassym.sh ${AMD64}/amd64/genassym.cf Makefile
124: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
125: ${PARAM} < ${AMD64}/amd64/genassym.cf > assym.h.tmp && \
126: mv -f assym.h.tmp assym.h
127:
128: param.c: $S/conf/param.c
129: rm -f param.c
130: cp $S/conf/param.c .
131:
132: param.o: param.c Makefile
133: ${NORMAL_C_C}
134:
135: ioconf.o: ioconf.c
136: ${NORMAL_C}
137:
138: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
139: sh $S/conf/newvers.sh
140: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
141:
142:
143: clean::
144: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
145: [Ee]rrs linterrs makelinks assym.h
146:
147: lint:
148: @lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
149: ${CFILES} ioconf.c param.c | \
150: grep -v 'static function .* unused'
151:
152: tags:
153: @echo "see $S/kern/Makefile for tags"
154:
155: links:
156: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
157: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
158: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
159: sort -u | comm -23 - dontlink | \
160: sed 's,.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
161: sh makelinks && rm -f dontlink makelinks
162:
163: AFILES= ${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S ${AMD64}/amd64/copy.S \
164: ${AMD64}/amd64/spl.S
165: SRCS= param.c ioconf.c ${AFILES} ${CFILES} ${SFILES}
166: depend:: .depend
167: .depend: ${SRCS} assym.h param.c ${APMINC}
168: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES}
169: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
170: # ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
171:
172:
173: # depend on root or device configuration
174: autoconf.o conf.o: Makefile
175:
176: # depend on network or filesystem configuration
177: uipc_domain.o uipc_proto.o vfs_conf.o: Makefile
178: if.o if_tun.o if_loop.o if_ethersubr.o: Makefile
179: if_arp.o if_ether.o: Makefile
180: ip_input.o ip_output.o in_pcb.o in_proto.o: Makefile
181: tcp_subr.o tcp_timer.o tcp_output.o: Makefile
182:
183: # depend on maxusers
184: machdep.o: Makefile
185:
186: # depend on CPU configuration
187: locore.o machdep.o: Makefile
188:
189:
190: locore.o: ${AMD64}/amd64/locore.S assym.h
191: ${NORMAL_S}
192:
193: vector.o: ${AMD64}/amd64/vector.S assym.h
194: ${NORMAL_S}
195:
196: copy.o: ${AMD64}/amd64/copy.S assym.h
197: ${NORMAL_S}
198:
199: spl.o: ${AMD64}/amd64/spl.S assym.h
200: ${NORMAL_S}
201:
202: # The install target can be redefined by putting a
203: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
204: MACHINE_NAME!= uname -n
205: install: install-kernel-${MACHINE_NAME}
206: .if !target(install-kernel-${MACHINE_NAME}})
207: install-kernel-${MACHINE_NAME}:
208: rm -f /obsd
209: ln /bsd /obsd
210: cp bsd /nbsd
211: mv /nbsd /bsd
212: .endif
213:
214: %RULES
CVSweb