Home | History | Annotate | Line # | Download | only in conf
Makefile.hp300 revision 1.16
      1 #	from: @(#)Makefile.hp300	8.2 (Berkeley) 1/23/94
      2 #	$Id: Makefile.hp300,v 1.16 1994/06/16 02:14:26 hpeyerl Exp $
      3 #
      4 # Makefile for 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/arch/hp300/conf/``machineid''
     10 # after which you should do
     11 #	 config machineid
     12 # Machine generic makefile changes should be made in
     13 #	/sys/arch/hp300/conf/Makefile.hp300
     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=	as ${DEBUG}
     26 CC=	cc ${DEBUG}
     27 CPP=	cpp
     28 LD=	ld
     29 TOUCH=	touch -f -c
     30 AWK=	awk
     31 
     32 # source tree is located via $S relative to the compilation directory
     33 S=	../../../..
     34 HP300=	../..
     35 
     36 INCLUDES= -I. -I$S/arch -I$S -I$S/sys
     37 COPTS=	${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Dhp300 -DFPCOPROC
     38 CFLAGS=	-O ${COPTS}
     39 
     40 ### find out what to use for libkern
     41 .include "$S/lib/libkern/Makefile.inc"
     42 .ifndef PROF
     43 LIBKERN=	${KERNLIB}
     44 .else
     45 LIBKERN=	${KERNLIB_PROF}
     46 .endif
     47 
     48 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     49 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     50 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     51 # is marked as config-dependent.
     52 
     53 NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     54 NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     55 
     56 DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     57 DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     58 
     59 PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     60 		sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
     61 		${AS} -o $@; \
     62 		rm -f $*.s
     63 
     64 NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     65 NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     66 
     67 %OBJS
     68 
     69 %CFILES
     70 
     71 # load lines for config "xxx" will be emitted as:
     72 # xxx: ${SYSTEM_DEP} swapxxx.o
     73 #	${SYSTEM_LD_HEAD}
     74 #	${SYSTEM_LD} swapxxx.o
     75 #	${SYSTEM_LD_TAIL}
     76 SYSTEM_OBJ=	locore.o vnode_if.o ${OBJS} param.o ioconf.o ${LIBKERN}
     77 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     78 SYSTEM_LD_HEAD=	rm -f $@
     79 SYSTEM_LD=	-@if [ X${DEBUG} = X-g ]; \
     80 		then strip=-X; \
     81 		else strip=-x; \
     82 		fi; \
     83 		echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
     84 		${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
     85 SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     86 		[ X${DEBUG} = X-g ] && { \
     87 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     88 		echo strip -d $@; strip -d $@; } || true
     89 
     90 %LOAD
     91 
     92 vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
     93 	sh $S/conf/newvers.sh
     94 	${CC} ${CFLAGS} -c vers.c
     95 
     96 clean:
     97 	rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \
     98 		[Ee]rrs linterrs makelinks
     99 
    100 lint: /tmp param.c
    101 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    102 	    ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \
    103 	    ioconf.c param.c | \
    104 	    grep -v 'struct/union .* never defined' | \
    105 	    grep -v 'possible pointer alignment problem'
    106 
    107 locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s 
    108 locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/include/pte.h
    109 locore.o: ${HP300}/include/cpu.h
    110 	${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o
    111 
    112 # the following is necessary because autoconf.o depends on #if GENERIC
    113 autoconf.o: Makefile
    114 
    115 # the following are necessary because the files depend on the types of
    116 # hp cpu's included in the system configuration
    117 machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile
    118 
    119 # depend on network or filesystem configuration
    120 uipc_proto.o vfs_conf.o locore.o: Makefile
    121 
    122 # depend on maxusers
    123 assym.s: Makefile
    124 
    125 assym.s: genassym
    126 	./genassym >assym.s
    127 
    128 genassym:
    129 	${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dhp300 -o genassym \
    130 	    ${HP300}/hp300/genassym.c
    131 
    132 depend: assym.s param.c vnode_if.h
    133 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    134 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c
    135 
    136 links:
    137 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    138 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    139 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    140 	  sort -u | comm -23 - dontlink | \
    141 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    142 	sh makelinks && rm -f dontlink
    143 
    144 tags:
    145 	@echo "see $S/kern/Makefile for tags"
    146 
    147 ioconf.o: ioconf.c
    148 	${CC} -c ${CFLAGS} ioconf.c
    149 
    150 param.c: $S/conf/param.c
    151 	rm -f param.c
    152 	cp $S/conf/param.c .
    153 
    154 param.o: param.c Makefile
    155 	${CC} -c ${CFLAGS} ${PARAM} param.c
    156 
    157 vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
    158 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    159 
    160 %RULES
    161