Makefile.i386 revision 267
1# Copyright 1990 W. Jolitz
2# @(#)Makefile.i386	7.1 5/10/91
3# Makefile for 4.3 BSD-Reno
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/i386/conf/``machineid''
9# after which you should do
10#	 config machineid
11# Generic makefile changes should be made in
12#	/sys/i386/conf/Makefile.i386
13# after which config should be rerun for all machines.
14#
15# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE 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
22TOUCH=	touch -f -c
23LD=	/usr/bin/ld
24CC=	cc 
25CPP=	cpp
26
27S=	../..
28I386=	../../i386
29
30INCLUDES= -I. -I$S -I$S/sys
31COPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
32ASFLAGS=
33CFLAGS=	-O ${DEBUG} ${COPTS}
34
35NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
36NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
37NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
38DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
39DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
40SYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o
41SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
42SYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
43SYSTEM_LD= @${LD} -z -T FE000000 -o $@ -X vers.o ${SYSTEM_OBJS}
44SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
45		dbsym $@ 2>/dev/null || true; size $@; chmod 755 $@
46
47GPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
48PROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
49		ex - $*.s < ${GPROF.EX} ; \
50		${AS} -o $@ $*.s ; \
51		rm -f $*.s
52
53%OBJS
54
55%CFILES
56
57%LOAD
58
59clean:
60	rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
61		errs linterrs makelinks genassym
62
63lint: /tmp param.c
64	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
65	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
66	    grep -v 'struct/union .* never defined' | \
67	    grep -v 'possible pointer alignment problem'
68
69symbols.sort: ${I386}/i386/symbols.raw
70	grep -v '^#' ${I386}/i386/symbols.raw \
71	    | sed 's/^	//' | sort -u > symbols.sort
72
73locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
74	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
75	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
76	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h
77	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
78		${AS} ${ASFLAGS} -o locore.o
79
80# the following is necessary because autoconf.o depends on #if GENERIC
81autoconf.o: Makefile
82
83# depend on network configuration
84af.o uipc_proto.o locore.o: Makefile
85
86# depend on maxusers
87assym.s machdep.o: Makefile
88
89# depends on KDB (cons.o also depends on GENERIC)
90trap.o cons.o: Makefile
91
92assym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h \
93    $S/sys/vmmeter.h \
94    $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h
95
96assym.s: genassym
97	./genassym >assym.s
98
99genassym:
100	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
101		 ${I386}/i386/genassym.c -o genassym
102
103depend: assym.s param.c
104	sh /usr/bin/mkdep ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
105	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
106
107links:
108	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
109	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
110	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
111	  sort -u | comm -23 - dontlink | \
112	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
113	sh makelinks && rm -f dontlink
114
115tags:
116	@echo "see $S/kern/Makefile for tags"
117
118ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
119    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
120	${CC} -c ${CFLAGS} ioconf.c
121
122conf.o: $S/sys/param.h $S/sys/systm.h $S/sys/buf.h $S/sys/ioctl.h \
123	$S/sys/tty.h $S/sys/conf.h \
124	bpfilter.h cd.h ch.h com.h dcfclk.h fd.h lpa.h \
125	lpt.h pty.h sd.h speaker.h st.h wd.h wt.h \
126	${I386}/i386/conf.c
127	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
128
129param.c: $S/conf/param.c \
130	$S/sys/param.h $S/sys/systm.h $S/sys/socket.h $S/sys/proc.h \
131	$S/sys/vnode.h $S/sys/file.h $S/sys/callout.h $S/sys/clist.h \
132	$S/sys/mbuf.h $S/ufs/quota.h $S/sys/kernel.h machine/vmparam.h \
133	$S/sys/shm.h
134	-rm -f param.c
135	cp $S/conf/param.c .
136
137param.o: param.c Makefile
138	${CC} -c ${CFLAGS} ${PARAM} param.c
139
140vers.o: ${SYSTEM_DEP}
141	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
142	${CC} ${CFLAGS} -c vers.c
143
144%RULES
145
146# DO NOT DELETE THIS LINE -- make depend uses it
147
148