1#	@(#)Makefile.news3400	7.11 (Berkeley) 01/21/93
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/vax/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# -DUUDMA	compile in unibus tu58 pseudo-dma code
21#
22
23CC=	gcc -traditional-cpp -fno-builtin -nostdinc
24AS=	cc2.11 -I
25LD=	/usr/local/gnu/lib/gcc-lib/mips-sony-bsd/2.2.2/ld
26
27S=	../..
28NEWS3400=	$S/news3400
29
30INCLUDES= -I. -I$S
31COPTS=	${INCLUDES} ${IDENT} -Unews3800 -Unews3700 -Dmips -DKERNEL
32CFLAGS=	${COPTS}
33AHEADS=
34
35INLINECMD=	${NEWS3400}/inline/obj/inline
36INLINE= ${INLINECMD} ${INLINEOPTS}
37
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
50NORMAL_S=	${AS} -c ${COPTS} $<
51NORMAL_S_C=	${AS} -c ${COPTS} ${PARAM} $<
52
53%OBJS
54
55%CFILES
56
57# load lines for config "xxx" will be emitted as:
58# xxx: ${SYSTEM_DEP} swapxxx.o
59#	${SYSTEM_LD_HEAD}
60#	${SYSTEM_LD} swapxxx.o
61#	${SYSTEM_LD_TAIL}
62SYSTEM_OBJ=	locore.o ${OBJS} param.o ioconf.o vnode_if.o
63#SYSTEM_DEP=	Makefile symbols.sort ${SYSTEM_OBJ}
64SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
65SYSTEM_LD_HEAD=	rm -f $@
66SYSTEM_LD=	@echo loading vmunix; \
67		${LD} -N -o $@ -e start -T 80001000 ${SYSTEM_OBJ} vers.o ../../libkern/obj/libkern.a
68SYSTEM_LD_TAIL= @echo done
69#SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@
70
71%LOAD
72
73newvers vers.c:
74	sh $S/conf/newvers.sh
75	${CC} $(CFLAGS) -c vers.c
76
77clean:
78	rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s assym.h \
79		vnode_if.c vnode_if.h \
80		Errs errs linterrs makelinks
81
82lint: /tmp param.c
83	@lint -hbxn -DGENERIC ${COPTS} ${PARAM} \
84	  ${NEWS3400}/news3400/Locore.c ${CFILES} ioconf.c param.c | \
85	    grep -v 'struct/union .* never defined' | \
86	    grep -v 'possible pointer alignment problem'
87
88#symbols.sort: ${NEWS3400}/news3400/symbols.raw
89#	grep -v '^#' ${NEWS3400}/news3400/symbols.raw \
90#	    | sed 's/^	//' | sort -u > symbols.sort
91
92${INLINECMD}:
93	cd ${NEWS3400}/inline; make
94
95locore.o: assym.h ${AHEADS} ${NEWS3400}/news3400/locore.s
96locore.o: ${NEWS3400}/include/param.h
97locore.o: ${NEWS3400}/include/vmparam.h
98locore.o: ${NEWS3400}/include/psl.h
99locore.o: ${NEWS3400}/include/reg.h
100locore.o: ${NEWS3400}/include/machAsmDefs.h
101locore.o: ${NEWS3400}/include/pte.h
102locore.o: ${NEWS3400}/include/endian.h
103locore.o: ${NEWS3400}/include/adrsmap.h
104locore.o:
105	${AS} -c -DLOCORE ${COPTS} ${PARAM} ${NEWS3400}/news3400/locore.s
106
107# the following is necessary because autoconf.o depends on #if GENERIC
108autoconf.o tu.o: Makefile
109
110# the following are necessary because the files depend on the types of
111# vax cpu's included in the system configuration
112clock.o machdep.o autoconf.o conf.o cons.o cpudata.o : Makefile
113
114# depend on network configuration
115af.o uipc_proto.o uipc_domain.o locore.o: Makefile
116
117# depends on kdb being configured
118trap.o:	Makefile
119
120assym.h: genassym
121	./genassym >assym.h
122
123genassym:
124	${CC} ${INCLUDES} ${IDENT} ${PARAM} -o genassym \
125	    ${NEWS3400}/news3400/genassym.c
126
127depend: assym.h param.c vnode_if.h
128	mkdep ${COPTS} ${CFILES} ioconf.c
129	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} \
130	    ${NEWS3400}/news3400/genassym.c
131
132links:
133	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
134	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
135	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
136	  sort -u | comm -23 - dontlink | \
137	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
138	echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
139	echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
140	sh makelinks && rm -f dontlink
141
142tags:
143	@echo "see $S/kern/Makefile for tags"
144
145ioconf.o:
146	${CC} -c ${COPTS} ioconf.c
147
148param.c: $S/conf/param.c
149	rm -f param.c
150	cp $S/conf/param.c .
151
152param.o: param.c Makefile
153	${CC} -c ${CFLAGS} ${PARAM} param.c
154
155vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src
156	sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
157vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
158	sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
159
160%RULES
161