Home | History | Annotate | Line # | Download | only in conf
Makefile.hp300 revision 1.27
      1 #	$NetBSD: Makefile.hp300,v 1.27 1995/10/18 22:50:15 thorpej 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 AWK=	awk
     28 CC=	cc ${DEBUG}
     29 CPP=	cpp
     30 LD=	ld
     31 TOUCH=	touch -f -c
     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} -D_KERNEL -Dmc68020 -Dhp300 -DFPCOPROC
     39 CFLAGS=	-O6 -Werror -fno-builtin ${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 ### find out what to use for libcompat
     50 .include "$S/compat/common/Makefile.inc"
     51 .ifndef PROF
     52 LIBCOMPAT=	${COMPATLIB}
     53 .else
     54 LIBCOMPAT=	${COMPATLIB_PROF}
     55 .endif
     56 
     57 ### for the Motorola 68040 Floating Point Software Product
     58 .include "$S/arch/m68k/fpsp/Makefile.inc"
     59 
     60 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     61 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     62 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     63 # is marked as config-dependent.
     64 
     65 NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     66 NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     67 
     68 DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     69 DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     70 
     71 PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     72 		sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
     73 		${AS} -o $@; \
     74 		rm -f $*.s
     75 
     76 NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     77 NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     78 
     79 %OBJS
     80 
     81 %CFILES
     82 
     83 # load lines for config "xxx" will be emitted as:
     84 # xxx: ${SYSTEM_DEP} swapxxx.o
     85 #	${SYSTEM_LD_HEAD}
     86 #	${SYSTEM_LD} swapxxx.o
     87 #	${SYSTEM_LD_TAIL}
     88 SYSTEM_OBJ=	locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \
     89 		${LIBKERN} ${LIBCOMPAT}
     90 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     91 SYSTEM_LD_HEAD=	rm -f $@
     92 SYSTEM_LD=	-@if [ X${DEBUG} = X-g ]; \
     93 		then strip=-X; \
     94 		else strip=-x; \
     95 		fi; \
     96 		echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
     97 		${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
     98 SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     99 		[ X${DEBUG} = X-g ] && { \
    100 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    101 		echo strip -d $@; strip -d $@; } || true
    102 
    103 %LOAD
    104 
    105 vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    106 	sh $S/conf/newvers.sh
    107 	${CC} ${CFLAGS} -c vers.c
    108 
    109 clean::
    110 	rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.o locore.i \
    111 		[a-z]*.s [Ee]rrs linterrs makelinks genassym
    112 
    113 lint: /tmp param.c
    114 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    115 	    ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \
    116 	    ioconf.c param.c | \
    117 	    grep -v 'struct/union .* never defined' | \
    118 	    grep -v 'possible pointer alignment problem'
    119 
    120 locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s 
    121 locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/include/pte.h
    122 locore.o: ${HP300}/include/cpu.h
    123 	${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o
    124 
    125 # the following is necessary because autoconf.o depends on #if GENERIC
    126 autoconf.o: Makefile
    127 
    128 # the following are necessary because the files depend on the types of
    129 # hp cpu's included in the system configuration
    130 machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile
    131 
    132 # depend on network or filesystem configuration
    133 uipc_proto.o vfs_conf.o locore.o: Makefile
    134 
    135 # depend on maxusers
    136 assym.s: Makefile
    137 
    138 assym.s: genassym
    139 	./genassym >assym.s
    140 
    141 genassym: ${HP300}/hp300/genassym.c Makefile
    142 	${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dhp300 -o genassym \
    143 	    ${HP300}/hp300/genassym.c
    144 
    145 depend: assym.s param.c vnode_if.h
    146 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    147 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c
    148 
    149 links:
    150 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    151 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    152 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    153 	  sort -u | comm -23 - dontlink | \
    154 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    155 	sh makelinks && rm -f dontlink
    156 
    157 tags:
    158 	@echo "see $S/kern/Makefile for tags"
    159 
    160 ioconf.o: ioconf.c
    161 	${CC} -c ${CFLAGS} ioconf.c
    162 
    163 param.c: $S/conf/param.c
    164 	rm -f param.c
    165 	cp $S/conf/param.c .
    166 
    167 param.o: param.c Makefile
    168 	${CC} -c ${CFLAGS} ${PARAM} param.c
    169 
    170 vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
    171 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    172 
    173 %RULES
    174