xref: /original-bsd/sys/i386/conf/Makefile.i386 (revision 63b2a11c)
1#	@(#)Makefile.i386	7.4 (Berkeley) 07/23/92
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
11# Machine generic makefile changes should be made in
12#	/sys/conf/Makefile.``machinetype''
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
22# DEBUG is set to -g by config if debugging is requested.
23# PROF is set to -pg by config if profiling is requested.
24AS=	as ${DEBUG}
25CC=	cc ${DEBUG}
26CPP=	cpp
27LD=	ld
28TOUCH=	touch -f -c
29GPROF.EX=/usr/src/usr.lib/libc/csu/i386/gmon.ex
30
31# source tree is located via $S relative to the compilation directory
32S=	../..
33I386=	$S/i386
34
35INCLUDES= -I. -I$S -I$S/sys
36COPTS+=	${INCLUDES} ${IDENT} -DKERNEL
37CFLAGS=	-O ${COPTS}
38
39# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
40# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
41# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
42# is marked as config-dependent.
43
44NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
45NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
46
47DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
48DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
49
50PROFILE_C=	${CC} -S -c ${COPTS} $<; \
51		ex - $*.s < ${GPROF.EX}; \
52		${AS} -o $@ $*.s; \
53		rm -f $*.s
54
55NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
56NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
57
58%OBJS
59
60%CFILES
61
62# load lines for config "xxx" will be emitted as:
63# xxx: ${SYSTEM_DEP} swapxxx.o
64#	${SYSTEM_LD_HEAD}
65#	${SYSTEM_LD} swapxxx.o
66#	${SYSTEM_LD_TAIL}
67SYSTEM_OBJ=	locore.o ${OBJS} param.o ioconf.o vnode_if.o
68#SYSTEM_DEP=	Makefile symbols.sort ${SYSTEM_OBJ}
69SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
70SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
71SYSTEM_LD=	@strip=-x; [ X${DEBUG} = X-g ] && strip=-X; \
72		${LD} $$strip -n -T FE000000 -o $@ ${SYSTEM_OBJ} vers.o \
73			../../quad/libquad.a
74#SYSTEM_LD_TAIL= @echo rearranging symbols;\
75#		symorder symbols.sort $@;\
76SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
77		[ X${DEBUG} = X-g ] && { \
78		echo cp $@ $@.gdb; cp $@ $@.gdb; \
79		echo strip -d $@; strip -d $@; }
80
81%LOAD
82
83newvers:
84	sh $S/conf/newvers.sh
85	${CC} $(CFLAGS) -c vers.c
86
87clean:
88	rm -f eddep *vmunix tags *.o locore.i [a-z]*.s \
89		Errs errs linterrs makelinks
90
91lint: /tmp param.c
92	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
93	    ${I386}/i386/Locore.c ${CFILES} ${I386}/i386/swapgeneric.c \
94	    ioconf.c param.c| \
95	    grep -v 'struct/union .* never defined' | \
96	    grep -v 'possible pointer alignment problem'
97
98symbols.sort: ${I386}/i386/symbols.raw
99	grep -v '^#' ${I386}/i386/symbols.raw \
100	    | sed 's/^	//' | sort -u > symbols.sort
101
102locore.o: assym.s vector.s ${I386}/i386/locore.s
103locore.o: ${I386}/include/trap.h ${I386}/include/psl.h ${I386}/i386/pte.h
104locore.o: ${I386}/include/cpu.h
105	${CPP} -DLOCORE ${COPTS} ${I386}/i386/locore.s | ${AS} -o locore.o
106
107# the following is necessary because autoconf.o depends on #if GENERIC
108autoconf.o: Makefile
109
110# the following are necessary because the files depend on the types of
111# hp cpu's included in the system configuration
112clock.o machdep.o autoconf.o conf.o: Makefile
113
114# depend on network configuration
115af.o uipc_proto.o locore.o: Makefile
116
117# depend on maxusers
118assym.s: Makefile
119
120assym.s: genassym
121	./genassym >assym.s
122
123genassym:
124	${CC} ${INCLUDES} ${IDENT} ${PARAM} -Di386 -o genassym \
125	    ${I386}/i386/genassym.c
126
127depend: assym.s param.c vnode_if.h
128	mkdep ${COPTS} ${CFILES} ioconf.c param.c
129	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
130
131links:
132	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
133	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
134	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
135	  sort -u | comm -23 - dontlink | \
136	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
137	sh makelinks && rm -f dontlink
138
139tags:
140	@echo "see $S/kern/Makefile for tags"
141
142ioconf.o: ioconf.c
143	${CC} -c ${CFLAGS} ioconf.c
144
145param.c: $S/conf/param.c
146	rm -f param.c
147	cp $S/conf/param.c .
148
149param.o: param.c Makefile
150	${CC} -c ${CFLAGS} ${PARAM} param.c
151
152vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src
153	sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
154vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
155	sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
156
157%RULES
158