Makefile.sparc revision 1.6 1 1.1 deraadt # from: @(#)Makefile.sparc 8.1 (Berkeley) 7/19/93
2 1.5 deraadt # $Id: Makefile.sparc,v 1.6 1994/02/04 17:27:28 deraadt Exp $
3 1.1 deraadt # Makefile for 4.4 BSD
4 1.1 deraadt #
5 1.1 deraadt # This makefile is constructed from a machine description:
6 1.1 deraadt # config machineid
7 1.1 deraadt # Most changes should be made in the machine description
8 1.1 deraadt # /sys/conf/``machineid''
9 1.1 deraadt # after which you should do
10 1.1 deraadt # config machineid
11 1.1 deraadt # Machine generic makefile changes should be made in
12 1.1 deraadt # /sys/conf/Makefile.``machinetype''
13 1.1 deraadt # after which config should be rerun for all machines of that type.
14 1.1 deraadt #
15 1.1 deraadt # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
16 1.1 deraadt # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
17 1.1 deraadt #
18 1.1 deraadt # -DTRACE compile in kernel tracing hooks
19 1.1 deraadt # -DQUOTA compile in file system quotas
20 1.1 deraadt
21 1.1 deraadt # DEBUG is set to -g if debugging.
22 1.1 deraadt # PROF is set to -pg if profiling.
23 1.1 deraadt
24 1.1 deraadt AS?= as
25 1.1 deraadt
26 1.5 deraadt CC= cc ${DEBUG}
27 1.1 deraadt CPP= cpp
28 1.1 deraadt LD= ld
29 1.1 deraadt TOUCH= touch -f -c
30 1.1 deraadt
31 1.1 deraadt # source tree is located via $S relative to the compilation directory
32 1.2 deraadt S= ../../../..
33 1.2 deraadt SPARC= ../..
34 1.1 deraadt
35 1.3 deraadt INCLUDES= -I. -I$S/arch -I$S -I$S/sys
36 1.1 deraadt COPTS= ${INCLUDES} ${IDENT} -DKERNEL -DSUN4C -Dsun4c
37 1.2 deraadt CFLAGS= ${COPTS}
38 1.1 deraadt
39 1.5 deraadt ### find out what to use for libkern
40 1.5 deraadt .include "$S/lib/libkern/Makefile.inc"
41 1.5 deraadt .ifndef PROF
42 1.5 deraadt LIBKERN= ${KERNLIB}
43 1.5 deraadt .else
44 1.5 deraadt LIBKERN= ${KERNLIB_PROF}
45 1.5 deraadt .endif
46 1.5 deraadt
47 1.1 deraadt # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
48 1.1 deraadt # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
49 1.1 deraadt # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
50 1.1 deraadt # is marked as config-dependent.
51 1.1 deraadt
52 1.1 deraadt # sparc kernel uses volatile, rather than heavy "device-driver"s.
53 1.1 deraadt
54 1.1 deraadt NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
55 1.1 deraadt NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
56 1.1 deraadt
57 1.1 deraadt # optimizer breaks sometimes; temporary workaround uses ${NOOPT_C}
58 1.1 deraadt NOOPT_C= ${CC} -c ${COPTS} ${PROF} ${PARAM} $<
59 1.1 deraadt
60 1.1 deraadt NORMAL_S= rm -f $*.c; ln -s $< $*.c; \
61 1.1 deraadt ${CC} ${COPTS} -I${SPARC}/sparc -E $*.c > $*.i; \
62 1.1 deraadt ${AS} -o $@ $*.i; rm -f $*.c $*.i
63 1.1 deraadt NORMAL_S_C= rm -f $*.c; ln -s $< $*.c; \
64 1.1 deraadt ${CC} ${COPTS} ${PARAM} -I${SPARC}/sparc -E $*.c > $*.i; \
65 1.1 deraadt ${AS} -o $@ $*.i; rm -f $*.c $*.i
66 1.1 deraadt
67 1.1 deraadt %OBJS
68 1.1 deraadt
69 1.1 deraadt %CFILES
70 1.1 deraadt
71 1.1 deraadt # load lines for config "xxx" will be emitted as:
72 1.1 deraadt # xxx: ${SYSTEM_DEP} swapxxx.o
73 1.1 deraadt # ${SYSTEM_LD_HEAD}
74 1.1 deraadt # ${SYSTEM_LD} swapxxx.o
75 1.1 deraadt # ${SYSTEM_LD_TAIL}
76 1.1 deraadt DEBUG?=
77 1.1 deraadt .if ${DEBUG} == "-g"
78 1.1 deraadt LDX=-X
79 1.1 deraadt .else
80 1.1 deraadt LDX=-x
81 1.1 deraadt .endif
82 1.5 deraadt SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o ${LIBKERN}
83 1.1 deraadt SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
84 1.5 deraadt SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
85 1.5 deraadt SYSTEM_LD= @${LD} ${LDX} -p -N -e start -T f8004000 -o $@ \
86 1.5 deraadt ${SYSTEM_OBJ} vers.o
87 1.5 deraadt SYSTEM_LD_TAIL= @echo rearranging symbols; size $@; chmod 755 $@
88 1.1 deraadt #.if ${DEBUG} == "-g"
89 1.1 deraadt #SYSTEM_LD_TAIL+=; echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
90 1.1 deraadt # echo strip -d $@; strip -d $@
91 1.1 deraadt #.endif
92 1.1 deraadt
93 1.1 deraadt %LOAD
94 1.1 deraadt
95 1.1 deraadt newvers:
96 1.1 deraadt sh $S/conf/newvers.sh
97 1.1 deraadt ${CC} ${CFLAGS} -c vers.c
98 1.1 deraadt
99 1.1 deraadt clean:
100 1.2 deraadt rm -f eddep *netbsd netbsd.gdb tags tags1 *.[io] [a-z]*.s \
101 1.1 deraadt Errs errs linterrs makelinks
102 1.1 deraadt
103 1.1 deraadt locore.o: ${SPARC}/sparc/locore.s assym.s
104 1.1 deraadt ${NORMAL_S}
105 1.1 deraadt
106 1.1 deraadt # depend on maxusers
107 1.1 deraadt assym.s: Makefile
108 1.1 deraadt
109 1.1 deraadt ./assym.s: assym.s
110 1.1 deraadt assym.s: genassym
111 1.1 deraadt ./genassym >assym.s
112 1.1 deraadt
113 1.1 deraadt genassym: genassym.o
114 1.1 deraadt ${CC} -o $@ genassym.o
115 1.1 deraadt
116 1.1 deraadt genassym.o: ${SPARC}/sparc/genassym.c
117 1.3 deraadt ${CC} -c ${CFLAGS} -I/tmp/usr/include -I/usr/include ${PARAM} $<
118 1.1 deraadt
119 1.6 deraadt SRCS= ${CFILES} ioconf.c param.c
120 1.1 deraadt depend: .depend
121 1.4 deraadt .depend: ${SRCS} assym.s
122 1.1 deraadt mkdep ${COPTS} ${SRCS}
123 1.6 deraadt mkdep -a -p ${COPTS} ${SPARC}/sparc/genassym.c
124 1.1 deraadt
125 1.1 deraadt links:
126 1.1 deraadt egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
127 1.1 deraadt sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
128 1.1 deraadt echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
129 1.1 deraadt sort -u | comm -23 - dontlink | \
130 1.1 deraadt sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
131 1.1 deraadt sh makelinks && rm -f dontlink
132 1.1 deraadt
133 1.1 deraadt tags: depend
134 1.1 deraadt sh $S/conf/systags.sh
135 1.1 deraadt rm -f tags1
136 1.1 deraadt sed -e 's, ../, ,' tags > tags1
137 1.1 deraadt
138 1.1 deraadt ioconf.o: ioconf.c
139 1.1 deraadt ${CC} -c ${CFLAGS} ioconf.c
140 1.1 deraadt
141 1.1 deraadt param.c: $S/conf/param.c
142 1.1 deraadt rm -f param.c
143 1.1 deraadt cp $S/conf/param.c .
144 1.1 deraadt
145 1.1 deraadt param.o: param.c Makefile
146 1.1 deraadt ${CC} -c ${CFLAGS} ${PARAM} param.c
147 1.1 deraadt
148 1.1 deraadt %RULES
149 1.5 deraadt
150 1.5 deraadt # DO NOT DELETE THIS LINE -- make depend uses it
151 1.5 deraadt
152