Commit | Line | Data |
---|---|---|
d2e46dcd | 1 | # @(#)Makefile.hp300 7.21 (Berkeley) %G% |
77df1ba3 KM |
2 | # |
3 | # Makefile for 4.4 BSD | |
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/conf/``machineid'' | |
9 | # after which you should do | |
10 | # config machineid | |
b28b3a13 | 11 | # Machine generic makefile changes should be made in |
77df1ba3 | 12 | # /sys/conf/Makefile.``machinetype'' |
b28b3a13 | 13 | # after which config should be rerun for all machines of that type. |
77df1ba3 KM |
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 | |
8b2dc27c MK |
20 | |
21 | ||
22 | # DEBUG is set to -g by config if debugging is requested (config -g). | |
23 | # PROF is set to -pg by config if profiling is requested (config -p). | |
24 | AS= as ${DEBUG} | |
25 | CC= cc ${DEBUG} | |
b3ceaca8 | 26 | CPP= cpp |
731b4a98 | 27 | LD= ld |
77df1ba3 KM |
28 | TOUCH= touch -f -c |
29 | ||
8b2dc27c | 30 | # source tree is located via $S relative to the compilation directory |
b28b3a13 | 31 | S= ../.. |
8b2dc27c | 32 | HP300= $S/hp300 |
b28b3a13 KB |
33 | |
34 | INCLUDES= -I. -I$S -I$S/sys | |
59309a7e | 35 | COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Dhp300 -DFPCOPROC |
77df1ba3 KM |
36 | CFLAGS= -O ${COPTS} |
37 | ||
8b2dc27c MK |
38 | # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} |
39 | # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, | |
40 | # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file | |
41 | # is marked as config-dependent. | |
42 | ||
43 | NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
44 | NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
45 | ||
46 | DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
47 | DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
48 | ||
49 | PROFILE_C= ${CC} -S -c ${COPTS} $<; \ | |
2bfb9e55 KM |
50 | sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ |
51 | ${AS} -o $@; \ | |
8b2dc27c MK |
52 | rm -f $*.s |
53 | ||
54 | NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ | |
55 | NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ | |
56 | ||
77df1ba3 KM |
57 | %OBJS |
58 | ||
59 | %CFILES | |
60 | ||
8b2dc27c MK |
61 | # load lines for config "xxx" will be emitted as: |
62 | # xxx: ${SYSTEM_DEP} swapxxx.o | |
63 | # ${SYSTEM_LD_HEAD} | |
64 | # ${SYSTEM_LD} swapxxx.o | |
65 | # ${SYSTEM_LD_TAIL} | |
a9eb1289 | 66 | SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o vnode_if.o |
59309a7e MH |
67 | #SYSTEM_DEP= Makefile symbols.sort ${SYSTEM_OBJ} libkern.a |
68 | SYSTEM_DEP= Makefile ${SYSTEM_OBJ} libkern.a | |
a87c9e57 | 69 | SYSTEM_LD_HEAD= rm -f $@ |
9acfa6cd | 70 | SYSTEM_LD= -@if [ X${DEBUG} = X-g ]; \ |
a87c9e57 MK |
71 | then strip=-X; \ |
72 | else strip=-x; \ | |
73 | fi; \ | |
59309a7e MH |
74 | echo ${LD} $$strip -n -o $@ -e start '$${SYSTEM_OBJ}' vers.o libkern.a; \ |
75 | ${LD} $$strip -n -o $@ -e start ${SYSTEM_OBJ} vers.o libkern.a | |
8b2dc27c MK |
76 | #SYSTEM_LD_TAIL= @echo rearranging symbols;\ |
77 | # symorder symbols.sort $@;\ | |
78 | SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ | |
79 | [ X${DEBUG} = X-g ] && { \ | |
80 | echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ | |
81 | echo strip -d $@; strip -d $@; } || true | |
82 | ||
77df1ba3 KM |
83 | %LOAD |
84 | ||
59309a7e MH |
85 | libkern.a: |
86 | -@if [ X${PROF} = X ]; \ | |
d2e46dcd KS |
87 | then ln -s $S/libkern/obj/libkern.a libkern.a; \ |
88 | else ln -s $S/libkern/obj/libkern_p.a libkern.a; \ | |
59309a7e | 89 | fi; \ |
d2e46dcd | 90 | echo ln -s $S/libkern/obj/libkern.a libkern.a |
59309a7e | 91 | |
8b2dc27c MK |
92 | newvers: |
93 | sh $S/conf/newvers.sh | |
94 | ${CC} $(CFLAGS) -c vers.c | |
95 | ||
77df1ba3 | 96 | clean: |
a87c9e57 | 97 | rm -f eddep *vmunix vmunix.gdb tags *.o locore.i [a-z]*.s \ |
b28b3a13 | 98 | Errs errs linterrs makelinks |
77df1ba3 | 99 | |
b28b3a13 | 100 | lint: /tmp param.c |
77df1ba3 | 101 | @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ |
b28b3a13 KB |
102 | ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \ |
103 | ioconf.c param.c| \ | |
77df1ba3 KM |
104 | grep -v 'struct/union .* never defined' | \ |
105 | grep -v 'possible pointer alignment problem' | |
106 | ||
b28b3a13 KB |
107 | symbols.sort: ${HP300}/hp300/symbols.raw |
108 | grep -v '^#' ${HP300}/hp300/symbols.raw \ | |
109 | | sed 's/^ //' | sort -u > symbols.sort | |
110 | ||
111 | locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s | |
b3ceaca8 | 112 | locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/hp300/pte.h |
b28b3a13 | 113 | locore.o: ${HP300}/include/cpu.h |
b3ceaca8 | 114 | ${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o |
77df1ba3 | 115 | |
77df1ba3 KM |
116 | # the following is necessary because autoconf.o depends on #if GENERIC |
117 | autoconf.o: Makefile | |
118 | ||
119 | # the following are necessary because the files depend on the types of | |
120 | # hp cpu's included in the system configuration | |
59309a7e | 121 | machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile |
77df1ba3 | 122 | |
da09249e KM |
123 | # depend on network or filesystem configuration |
124 | af.o uipc_proto.o vfs_conf.o locore.o: Makefile | |
77df1ba3 KM |
125 | |
126 | # depend on maxusers | |
127 | assym.s: Makefile | |
128 | ||
a0b15fca MK |
129 | assym.s: genassym |
130 | ./genassym >assym.s | |
131 | ||
132 | genassym: | |
b28b3a13 KB |
133 | ${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dhp300 -o genassym \ |
134 | ${HP300}/hp300/genassym.c | |
a0b15fca | 135 | |
a9eb1289 | 136 | depend: assym.s param.c vnode_if.h |
b3ceaca8 | 137 | mkdep ${COPTS} ${CFILES} ioconf.c param.c |
b28b3a13 | 138 | mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c |
77df1ba3 KM |
139 | |
140 | links: | |
b28b3a13 | 141 | egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ |
77df1ba3 KM |
142 | sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink |
143 | echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ | |
144 | sort -u | comm -23 - dontlink | \ | |
145 | sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks | |
146 | sh makelinks && rm -f dontlink | |
147 | ||
148 | tags: | |
b28b3a13 | 149 | @echo "see $S/kern/Makefile for tags" |
77df1ba3 KM |
150 | |
151 | ioconf.o: ioconf.c | |
152 | ${CC} -c ${CFLAGS} ioconf.c | |
153 | ||
b28b3a13 KB |
154 | param.c: $S/conf/param.c |
155 | rm -f param.c | |
156 | cp $S/conf/param.c . | |
77df1ba3 KM |
157 | |
158 | param.o: param.c Makefile | |
159 | ${CC} -c ${CFLAGS} ${PARAM} param.c | |
160 | ||
de1a4c10 KB |
161 | vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src |
162 | sh $S/kern/vnode_if.sh $S/kern/vnode_if.src | |
163 | vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src | |
164 | sh $S/kern/vnode_if.sh $S/kern/vnode_if.src | |
165 | ||
77df1ba3 | 166 | %RULES |