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