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