Home | History | Annotate | Line # | Download | only in conf
Makefile.hp300 revision 1.20
      1 #	$NetBSD: Makefile.hp300,v 1.20 1994/10/26 07:23:13 cgd Exp $
      2 
      3 #	@(#)Makefile.hp300	8.2 (Berkeley) 1/23/94
      4 #
      5 # Makefile for NetBSD
      6 #
      7 # This makefile is constructed from a machine description:
      8 #	config machineid
      9 # Most changes should be made in the machine description
     10 #	/sys/arch/hp300/conf/``machineid''
     11 # after which you should do
     12 #	 config machineid
     13 # Machine generic makefile changes should be made in
     14 #	/sys/arch/hp300/conf/Makefile.hp300
     15 # after which config should be rerun for all machines of that type.
     16 #
     17 # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     18 #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     19 #
     20 # -DTRACE	compile in kernel tracing hooks
     21 # -DQUOTA	compile in file system quotas
     22 
     23 
     24 # DEBUG is set to -g by config if debugging is requested (config -g).
     25 # PROF is set to -pg by config if profiling is requested (config -p).
     26 AS=	as ${DEBUG}
     27 CC=	cc ${DEBUG}
     28 CPP=	cpp
     29 LD=	ld
     30 TOUCH=	touch -f -c
     31 AWK=	awk
     32 
     33 # source tree is located via $S relative to the compilation directory
     34 S=	../../../..
     35 HP300=	../..
     36 
     37 INCLUDES= -I. -I$S/arch -I$S -I$S/sys
     38 COPTS=	${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Dhp300 -DFPCOPROC
     39 CFLAGS=	-O6 ${COPTS}
     40 
     41 ### find out what to use for libkern
     42 .include "$S/lib/libkern/Makefile.inc"
     43 .ifndef PROF
     44 LIBKERN=	${KERNLIB}
     45 .else
     46 LIBKERN=	${KERNLIB_PROF}
     47 .endif
     48 
     49 ### for the Motorola 68040 Floating Point Software Product
     50 .include "$S/arch/m68k/fpsp/Makefile.inc"
     51 
     52 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     53 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     54 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     55 # is marked as config-dependent.
     56 
     57 NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     58 NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     59 
     60 DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     61 DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     62 
     63 PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     64 		sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
     65 		${AS} -o $@; \
     66 		rm -f $*.s
     67 
     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 ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o ${LIBKERN}
     81 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     82 SYSTEM_LD_HEAD=	rm -f $@
     83 SYSTEM_LD=	-@if [ X${DEBUG} = X-g ]; \
     84 		then strip=-X; \
     85 		else strip=-x; \
     86 		fi; \
     87 		echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
     88 		${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
     89 SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     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 vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
     97 	sh $S/conf/newvers.sh
     98 	${CC} ${CFLAGS} -c vers.c
     99 
    100 clean:
    101 	rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \
    102 		[Ee]rrs linterrs makelinks
    103 
    104 lint: /tmp param.c
    105 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    106 	    ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \
    107 	    ioconf.c param.c | \
    108 	    grep -v 'struct/union .* never defined' | \
    109 	    grep -v 'possible pointer alignment problem'
    110 
    111 locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s 
    112 locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/include/pte.h
    113 locore.o: ${HP300}/include/cpu.h
    114 	${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o
    115 
    116 # the following is necessary because autoconf.o depends on #if GENERIC
    117 autoconf.o: Makefile
    118 
    119 # the following are necessary because the files depend on the types of
    120 # hp cpu's included in the system configuration
    121 machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile
    122 
    123 # depend on network or filesystem configuration
    124 uipc_proto.o vfs_conf.o locore.o: Makefile
    125 
    126 # depend on maxusers
    127 assym.s: Makefile
    128 
    129 assym.s: genassym
    130 	./genassym >assym.s
    131 
    132 genassym: ${HP300}/hp300/genassym.c
    133 	${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dhp300 -o genassym \
    134 	    ${HP300}/hp300/genassym.c
    135 
    136 depend: assym.s param.c vnode_if.h
    137 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    138 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c
    139 
    140 links:
    141 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    142 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    143 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    144 	  sort -u | comm -23 - dontlink | \
    145 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    146 	sh makelinks && rm -f dontlink
    147 
    148 tags:
    149 	@echo "see $S/kern/Makefile for tags"
    150 
    151 ioconf.o: ioconf.c
    152 	${CC} -c ${CFLAGS} ioconf.c
    153 
    154 param.c: $S/conf/param.c
    155 	rm -f param.c
    156 	cp $S/conf/param.c .
    157 
    158 param.o: param.c Makefile
    159 	${CC} -c ${CFLAGS} ${PARAM} param.c
    160 
    161 vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
    162 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    163 
    164 %RULES
    165