Home | History | Annotate | Line # | Download | only in conf
Makefile.hp300 revision 1.8
      1 #	from: @(#)Makefile.hp300	7.10 (Berkeley) 6/27/91
      2 #	$Id: Makefile.hp300,v 1.8 1993/08/16 16:23:38 mycroft Exp $
      3 #
      4 # Makefile for 4.4 BSD
      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=	as ${DEBUG}
     26 CC=	cc ${DEBUG}
     27 CPP=	cpp
     28 LD=	ld
     29 TOUCH=	touch -f -c
     30 GPROF.EX=/usr/src/usr.lib/libc/csu/hp300/gmon.ex
     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 -DREFBIT
     38 CFLAGS=	-O ${COPTS}
     39 
     40 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     41 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     42 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     43 # is marked as config-dependent.
     44 
     45 NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     46 NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     47 
     48 DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     49 DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     50 
     51 PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     52 		ex - $*.s < ${GPROF.EX}; \
     53 		${AS} -o $@ $*.s; \
     54 		rm -f $*.s
     55 
     56 NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     57 NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     58 
     59 %OBJS
     60 
     61 %CFILES
     62 
     63 # load lines for config "xxx" will be emitted as:
     64 # xxx: ${SYSTEM_DEP} swapxxx.o
     65 #	${SYSTEM_LD_HEAD}
     66 #	${SYSTEM_LD} swapxxx.o
     67 #	${SYSTEM_LD_TAIL}
     68 SYSTEM_OBJ=	locore.o ${OBJS} param.o ioconf.o
     69 #SYSTEM_DEP=	Makefile symbols.sort ${SYSTEM_OBJ}
     70 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     71 SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
     72 SYSTEM_LD=	@strip=-x; [ X${DEBUG} = X-g ] && strip=-X || true; \
     73 		${LD} -T ${LOAD_ADDRESS} -n -o $@ -e start ${SYSTEM_OBJ} vers.o
     74 #SYSTEM_LD_TAIL= @echo rearranging symbols;\
     75 #		symorder symbols.sort $@;\
     76 SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     77 		[ X${DEBUG} = X-g ] && { \
     78 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     79 		echo strip -d $@; strip -d $@; } || true
     80 
     81 %LOAD
     82 
     83 vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
     84 	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
     85 	${CC} ${CFLAGS} -c vers.c
     86 
     87 clean:
     88 	rm -f eddep *netbsd tags *.o locore.i [a-z]*.s \
     89 		[Ee]rrs linterrs makelinks
     90 
     91 lint: /tmp param.c
     92 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
     93 	    ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \
     94 	    ioconf.c param.c| \
     95 	    grep -v 'struct/union .* never defined' | \
     96 	    grep -v 'possible pointer alignment problem'
     97 
     98 symbols.sort: ${HP300}/hp300/symbols.raw
     99 	grep -v '^#' ${HP300}/hp300/symbols.raw \
    100 	    | sed 's/^	//' | sort -u > symbols.sort
    101 
    102 locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s 
    103 locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/include/pte.h
    104 locore.o: ${HP300}/include/cpu.h
    105 	${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o
    106 
    107 # the following is necessary because autoconf.o depends on #if GENERIC
    108 autoconf.o: Makefile
    109 
    110 # the following are necessary because the files depend on the types of
    111 # hp cpu's included in the system configuration
    112 clock.o machdep.o autoconf.o conf.o: Makefile
    113 
    114 # depend on network configuration
    115 af.o uipc_proto.o locore.o: Makefile
    116 
    117 # depend on maxusers
    118 assym.s: Makefile
    119 
    120 assym.s: genassym
    121 	./genassym >assym.s
    122 
    123 genassym:
    124 	${CC} ${INCLUDES} ${IDENT} -DKERNEL ${PARAM} -Dmc68020 -Dhp300 -o genassym \
    125 	    ${HP300}/hp300/genassym.c
    126 
    127 depend: assym.s param.c
    128 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    129 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c
    130 
    131 links:
    132 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    133 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    134 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    135 	  sort -u | comm -23 - dontlink | \
    136 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    137 	sh makelinks && rm -f dontlink
    138 
    139 tags:
    140 	@echo "see $S/kern/Makefile for tags"
    141 
    142 ioconf.o: ioconf.c
    143 	${CC} -c ${CFLAGS} ioconf.c
    144 
    145 param.c: $S/conf/param.c
    146 	rm -f param.c
    147 	cp $S/conf/param.c .
    148 
    149 param.o: param.c Makefile
    150 	${CC} -c ${CFLAGS} ${PARAM} param.c
    151 
    152 %RULES
    153