xref: /original-bsd/sys/pmax/conf/Makefile.pmax (revision 7eb91141)
1#	@(#)Makefile.pmax	7.3 (Berkeley) 02/29/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
29
30# source tree is located via $S relative to the compilation directory
31S=	../..
32PMAX=	$S/pmax
33
34INCLUDES= -I. -I$S -I$S/sys
35COPTS=	${INCLUDES} ${IDENT} -DKERNEL
36CFLAGS=	-O ${COPTS}
37AFLAGS=	-O2 -DLOCORE ${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 ${COPTS} ${PROF} $<
48DRIVER_C_C=	${CC} -c ${COPTS} ${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=	${CC} -c ${COPTS} $<
56NORMAL_S_C=	${CC} -c ${COPTS} ${PARAM} $<
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
68#SYSTEM_DEP=	Makefile symbols.sort ${SYSTEM_OBJ}
69SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
70SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
71SYSTEM_LD=	@${LD} -N -o $@ -e start -T 80030000 ${SYSTEM_OBJ} vers.o
72#SYSTEM_LD_TAIL= @echo rearranging symbols;\
73#		symorder symbols.sort $@;\
74#SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
75#		[ X${DEBUG} = X-g ] && { \
76#		echo cp $@ $@.gdb; cp $@ $@.gdb; \
77#		echo strip -d $@; strip -d $@; }
78SYSTEM_LD_TAIL=	@size $@; chmod 755 $@
79
80%LOAD
81
82newvers:
83	sh $S/conf/newvers.sh
84	${CC} $(CFLAGS) -c vers.c
85
86clean:
87	rm -f eddep *vmunix tags *.o [a-z]*.s \
88		errs linterrs makelinks
89
90lint: /tmp param.c
91	@lint -hbxn -DGENERIC ${COPTS} ${PARAM} \
92		machine/Locore.c ${CFILES} ioconf.c param.c
93
94symbols.sort: ${PMAX}/pmax/symbols.raw
95	grep -v '^#' ${PMAX}/pmax/symbols.raw \
96	    | sed 's/^	//' | sort -u > symbols.sort
97
98locore.o: ${PMAX}/pmax/locore.s ${PMAX}/include/machAsmDefs.h \
99	${PMAX}/include/machConst.h ${PMAX}/include/reg.h assym.h
100	${CC} -c ${AFLAGS} ${PARAM} ${PMAX}/pmax/locore.s
101
102# the following is necessary because autoconf.o depends on #if GENERIC
103autoconf.o: Makefile
104
105# the following are necessary because the files depend on the types of
106# cpu's included in the system configuration
107clock.o machdep.o autoconf.o conf.o: Makefile
108
109# depend on network configuration
110af.o uipc_proto.o: Makefile
111
112assym.h: genassym
113	./genassym >assym.h
114
115genassym: ${PMAX}/pmax/genassym.c
116	${CC} ${INCLUDES} ${IDENT} ${PARAM} -o genassym ${PMAX}/pmax/genassym.c
117
118depend: assym.h param.c
119	mkdep ${COPTS} ${CFILES} ioconf.c param.c
120	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${PMAX}/pmax/genassym.c
121
122links:
123	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
124	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
125	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
126	  sort -u | comm -23 - dontlink | \
127	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
128	sh makelinks && rm -f dontlink
129
130tags:
131	@echo "see $S/kern/Makefile for tags"
132
133ioconf.o: ioconf.c
134	${CC} -c ${CFLAGS} ioconf.c
135
136param.c: $S/conf/param.c
137	rm -f param.c
138	cp $S/conf/param.c .
139
140param.o: param.c Makefile
141	${CC} -c ${CFLAGS} ${PARAM} param.c
142
143%RULES
144