1*59181Storek# @(#)Makefile.sparc 7.1 (Berkeley) 04/20/93 2*59181Storek# 3*59181Storek# Makefile for 4.4 BSD 4*59181Storek# 5*59181Storek# This makefile is constructed from a machine description: 6*59181Storek# config machineid 7*59181Storek# Most changes should be made in the machine description 8*59181Storek# /sys/conf/``machineid'' 9*59181Storek# after which you should do 10*59181Storek# config machineid 11*59181Storek# Machine generic makefile changes should be made in 12*59181Storek# /sys/conf/Makefile.``machinetype'' 13*59181Storek# after which config should be rerun for all machines of that type. 14*59181Storek# 15*59181Storek# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 16*59181Storek# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 17*59181Storek# 18*59181Storek# -DTRACE compile in kernel tracing hooks 19*59181Storek# -DQUOTA compile in file system quotas 20*59181Storek 21*59181Storek# DEBUG is set to -g if debugging. 22*59181Storek# PROF is set to -pg if profiling. 23*59181Storek 24*59181StorekAS?= as 25*59181Storek 26*59181StorekCC= cc -W ${DEBUG} 27*59181StorekCPP= cpp 28*59181StorekLD= ld 29*59181StorekTOUCH= touch -f -c 30*59181Storek 31*59181Storek# source tree is located via $S relative to the compilation directory 32*59181StorekS= ../.. 33*59181StorekSPARC= $S/sparc 34*59181StorekLIBKERN=$S/libkern/obj/libkern.a 35*59181Storek 36*59181StorekINCLUDES=-I. -I$S -I$S/sys 37*59181StorekCOPTS= ${INCLUDES} ${IDENT} -DKERNEL -DSUN4C -Dsun4c 38*59181StorekCFLAGS= -O4 ${COPTS} 39*59181Storek 40*59181Storek# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 41*59181Storek# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 42*59181Storek# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 43*59181Storek# is marked as config-dependent. 44*59181Storek 45*59181Storek# sparc kernel uses volatile, rather than heavy "device-driver"s. 46*59181Storek 47*59181StorekNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 48*59181StorekNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 49*59181Storek 50*59181StorekNORMAL_S= rm -f $*.c; ln -s $< $*.c; \ 51*59181Storek ${CC} ${COPTS} -I${SPARC}/sparc -E $*.c > $*.i; \ 52*59181Storek ${AS} -o $@ $*.i; rm -f $*.c $*.i 53*59181StorekNORMAL_S_C= rm -f $*.c; ln -s $< $*.c; \ 54*59181Storek ${CC} ${COPTS} ${PARAM} -I${SPARC}/sparc -E $*.c > $*.i; \ 55*59181Storek ${AS} -o $@ $*.i; rm -f $*.c $*.i 56*59181Storek 57*59181Storek%OBJS 58*59181Storek 59*59181Storek%CFILES 60*59181Storek 61*59181Storek# load lines for config "xxx" will be emitted as: 62*59181Storek# xxx: ${SYSTEM_DEP} swapxxx.o 63*59181Storek# ${SYSTEM_LD_HEAD} 64*59181Storek# ${SYSTEM_LD} swapxxx.o 65*59181Storek# ${SYSTEM_LD_TAIL} 66*59181StorekDEBUG?= 67*59181Storek.if ${DEBUG} == "-g" 68*59181StorekLDX=-X 69*59181Storek.else 70*59181StorekLDX=-x 71*59181Storek.endif 72*59181StorekSYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o vnode_if.o 73*59181StorekSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 74*59181StorekSYSTEM_LD_HEAD= rm -f $@ 75*59181StorekSYSTEM_LD= -@echo ${LD} ${LDX} -p -N -e start -T f8004000 -o $@ \ 76*59181Storek '$${SYSTEM_OBJ}' vers.o ${LIBKERN}; \ 77*59181Storek ${LD} ${LDX} -p -N -e start -T f8004000 -o $@ \ 78*59181Storek ${SYSTEM_OBJ} vers.o ${LIBKERN} 79*59181StorekSYSTEM_LD_TAIL= @size $@; chmod 755 $@ 80*59181Storek#.if ${DEBUG} == "-g" 81*59181Storek#SYSTEM_LD_TAIL+=; echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 82*59181Storek# echo strip -d $@; strip -d $@ 83*59181Storek#.endif 84*59181Storek 85*59181Storek%LOAD 86*59181Storek 87*59181Storeknewvers: 88*59181Storek sh $S/conf/newvers.sh 89*59181Storek ${CC} ${CFLAGS} -c vers.c 90*59181Storek 91*59181Storekclean: 92*59181Storek rm -f eddep *vmunix vmunix.gdb tags tags1 *.[io] [a-z]*.s \ 93*59181Storek Errs errs linterrs makelinks 94*59181Storek 95*59181Storeklocore.o: ${SPARC}/sparc/locore.s assym.s 96*59181Storek ${NORMAL_S} 97*59181Storek 98*59181Storek# depend on maxusers 99*59181Storekassym.s: Makefile 100*59181Storek 101*59181Storek./assym.s: assym.s 102*59181Storekassym.s: genassym 103*59181Storek ./genassym >assym.s 104*59181Storek 105*59181Storekgenassym: genassym.o 106*59181Storek ${CC} -o $@ genassym.o 107*59181Storek 108*59181Storekgenassym.o: ${SPARC}/sparc/genassym.c 109*59181Storek ${CC} -c ${CFLAGS} ${PARAM} $< 110*59181Storek 111*59181StorekSRCS= ${CFILES} ${SPARC}/sparc/locore.s ${SPARC}/sparc/bsd_audiointr.s \ 112*59181Storek ${SPARC}/sparc/genassym.c ioconf.c param.c vnode_if.c 113*59181Storekdepend: .depend 114*59181Storek.depend: ${SRCS} assym.s 115*59181Storek mkdep ${COPTS} ${SRCS} 116*59181Storek 117*59181Storeklinks: 118*59181Storek egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 119*59181Storek sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 120*59181Storek echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 121*59181Storek sort -u | comm -23 - dontlink | \ 122*59181Storek sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 123*59181Storek sh makelinks && rm -f dontlink 124*59181Storek 125*59181Storektags: depend 126*59181Storek sh $S/conf/systags.sh 127*59181Storek rm -f tags1 128*59181Storek sed -e 's, ../, ,' tags > tags1 129*59181Storek 130*59181Storekioconf.o: ioconf.c 131*59181Storek ${CC} -c ${CFLAGS} ioconf.c 132*59181Storek 133*59181Storekparam.c: $S/conf/param.c 134*59181Storek rm -f param.c 135*59181Storek cp $S/conf/param.c . 136*59181Storek 137*59181Storekparam.o: param.c Makefile 138*59181Storek ${CC} -c ${CFLAGS} ${PARAM} param.c 139*59181Storek 140*59181Storekvnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 141*59181Storek sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 142*59181Storekvnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 143*59181Storek sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 144*59181Storek 145*59181Storek%RULES 146