Home | History | Annotate | Line # | Download | only in conf
Makefile.mac68k revision 1.13
      1 #	$NetBSD: Makefile.mac68k,v 1.13 1994/12/03 23:33:55 briggs Exp $
      2 
      3 # Makefile for NetBSD for the mac
      4 #	Derived from makefile for hp300 from NetBSD
      5 #
      6 # This makefile is constructed from a machine description:
      7 #	config machineid
      8 # Most changes should be made in the machine description
      9 #	/sys/conf/``machineid''
     10 # after which you should do
     11 #	 config machineid
     12 # Machine generic makefile changes should be made in
     13 #	/sys/conf/Makefile.``machinetype''
     14 # after which config should be rerun for all machines of that type.
     15 #
     16 # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     17 #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     18 #
     19 # -DTRACE	compile in kernel tracing hooks
     20 # -DQUOTA	compile in file system quotas
     21 
     22 
     23 # DEBUG is set to -g by config if debugging is requested (config -g).
     24 # PROF is set to -pg by config if profiling is requested (config -p).
     25 AS=	/usr/bin/as ${DEBUG}
     26 CC=	/usr/bin/cc ${DEBUG}
     27 LOCAL_CC=${CC}
     28 CPP=	/usr/bin/cpp
     29 LD=	/usr/bin/ld
     30 TOUCH=	touch -f -c
     31 GPROF.EX=/usr/src/lib/libc/csu.mac68k/gmon.ex
     32 
     33 # source tree is located via $S relative to the compilation directory
     34 S=	../../../..
     35 MAC68K=	../..
     36 .include "$S/lib/libkern/Makefile.inc"
     37 .ifndef PROF
     38 LIBKERN=${KERNLIB}
     39 .else
     40 LIBKERN=${KERNLIB_PROF}
     41 .endif
     42 
     43 ### for the Motorola 68040 Floating Point Software Product
     44 .include "$S/arch/m68k/fpsp/Makefile.inc"
     45 
     46 INCLUDES= -I. -I$S/arch -I$S -I$S/sys
     47 COPTS=	${INCLUDES} ${IDENT} -DKERNEL -DREFBIT -Dmac68k
     48 CFLAGS=	-O ${COPTS}
     49 
     50 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     51 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     52 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     53 # is marked as config-dependent.
     54 
     55 NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     56 NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     57 
     58 DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     59 DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     60 
     61 PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     62 		ex - $*.s < ${GPROF.EX}; \
     63 		${AS} -o $@ $*.s; \
     64 		rm -f $*.s
     65 
     66 # This really bites for now, but we need to run assembly through sed
     67 # until the real problem (cpp, I think) is fixed.
     68 NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     69 NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     70 
     71 %OBJS
     72 
     73 %CFILES
     74 
     75 # load lines for config "xxx" will be emitted as:
     76 # xxx: ${SYSTEM_DEP} swapxxx.o
     77 #	${SYSTEM_LD_HEAD}
     78 #	${SYSTEM_LD} swapxxx.o
     79 #	${SYSTEM_LD_TAIL}
     80 SYSTEM_OBJ=	locore.o vnode_if.o ${OBJS} param.o ioconf.o conf.o \
     81 		${FPSP} ${LIBKERN}
     82 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     83 SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
     84 SYSTEM_LD=	@strip=-x; [ X${DEBUG} = X-g ] && strip=-X || true; \
     85 		${LD} $$strip -n -T 0 -e start -o $@ \
     86 		${SYSTEM_OBJ} vers.o ${LIBKERN}
     87 #SYSTEM_LD_TAIL= @echo rearranging symbols;\
     88 #		symorder symbols.sort $@;\
     89 SYSTEM_LD_TAIL=	@chmod 755 $@; size $@; \
     90 		[ X${DEBUG} = X-g ] && { \
     91 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     92 		echo strip -d $@; strip -d $@; } || true
     93 
     94 %LOAD
     95 
     96 newvers:
     97 	sh $S/conf/newvers.sh "${KERN_IDENT}" ${IDENT}
     98 	${CC} ${CFLAGS} -c vers.c
     99 
    100 clean:
    101 	rm -f eddep *vmunix tags *.o locore.i [a-z]*.s \
    102 		Errs errs linterrs makelinks
    103 
    104 lint: /tmp param.c
    105 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    106 	    ${MAC68K}/mac68k/Locore.c ${CFILES} \
    107 	    ioconf.c param.c| \
    108 	    grep -v 'struct/union .* never defined' | \
    109 	    grep -v 'possible pointer alignment problem'
    110 
    111 symbols.sort: ${MAC68K}/mac68k/symbols.raw
    112 	grep -v '^#' ${MAC68K}/mac68k/symbols.raw \
    113 	    | sed 's/^	//' | sort -u > symbols.sort
    114 
    115 locore.o: assym.s ${MAC68K}/mac68k/vectors.s ${MAC68K}/mac68k/macglobals.s
    116 locore.o: ${MAC68K}/mac68k/locore.s 
    117 locore.o: ${MAC68K}/include/trap.h ${MAC68K}/include/psl.h
    118 locore.o: ${MAC68K}/include/pte.h ${MAC68K}/include/cpu.h
    119 	${CPP} -DLOCORE ${COPTS} ${MAC68K}/mac68k/locore.s | ${AS} -o locore.o
    120 
    121 # the following is necessary because autoconf.o depends on #if GENERIC
    122 autoconf.o: Makefile
    123 
    124 # the following are necessary because the files depend on the types of
    125 # hp cpu's included in the system configuration
    126 clock.o machdep.o autoconf.o conf.o: Makefile
    127 
    128 # depend on network configuration
    129 af.o uipc_proto.o locore.o: Makefile
    130 
    131 # depend on maxusers
    132 assym.s: Makefile
    133 
    134 assym.s: genassym
    135 	./genassym >assym.s
    136 
    137 genassym:
    138 	${LOCAL_CC} ${INCLUDES} ${IDENT} -DKERNEL ${PARAM} -o genassym \
    139 	    ${MAC68K}/mac68k/genassym.c
    140 
    141 depend: assym.s param.c vnode_if.h
    142 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    143 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${MAC68K}/mac68k/genassym.c
    144 
    145 links:
    146 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    147 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    148 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    149 	  sort -u | comm -23 - dontlink | \
    150 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    151 	sh makelinks && rm -f dontlink
    152 
    153 tags:
    154 	@echo "see $S/kern/Makefile for tags"
    155 
    156 ioconf.o: ioconf.c
    157 	${CC} -c ${CFLAGS} ioconf.c
    158 
    159 conf.o: ${MAC68K}/mac68k/conf.c
    160 	${NORMAL_C}
    161 
    162 param.c: $S/conf/param.c
    163 	rm -f param.c
    164 	cp $S/conf/param.c .
    165 
    166 param.o: param.c Makefile
    167 	${CC} -c ${CFLAGS} ${PARAM} -DHZ=60 param.c
    168 
    169 vnode_if.c vnode_if.h:  $S/kern/vnode_if.sh $S/kern/vnode_if.src
    170 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    171 
    172 %RULES
    173