# @(#)Makefile.hp300 7.10 (Berkeley) 6/27/91 # $Id: Makefile.mvme88k,v 1.3 1997/09/15 02:40:32 deraadt Exp $ # # Makefile for NetBSD # # This makefile is constructed from a machine description: # config machineid # Most changes should be made in the machine description # /sys/arch/mvme88k/conf/``machineid'' # after which you should do # config machineid # Machine generic makefile changes should be made in # /sys/arch/mvme88k/conf/Makefile.mvme88k # after which config should be rerun for all machines of that type. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DTRACE compile in kernel tracing hooks # -DQUOTA compile in file system quotas # DEBUG is set to -g by config if debugging is requested (config -g). # PROF is set to -pg by config if profiling is requested (config -p). AS= as ${DEBUG} AWK= awk CC= cc ${DEBUG} CPP= cpp LD= ld TOUCH= touch -f -c .ifndef HOSTCC HOSTCC=cc .endif # source tree is located via $S relative to the compilation directory S= ../../../.. MVME88K= ../.. INCLUDES= -I. -I$S/arch -I$S -I$S/sys .if defined(DESTDIR) INCLUDES+= -nostdinc -idirafter ${DESTDIR}/usr/include .endif CPPFLAGS= ${INCLUDES} ${IDENT} -DKERNEL -D_KERNEL -Dmvme88k -Dm88k CFLAGS= -O ${DEBUG} #-Werror ### find out what to use for libkern .include "$S/lib/libkern/Makefile.inc" .ifndef PROF LIBKERN= ${KERNLIB} .else LIBKERN= ${KERNLIB_PROF} .endif ### find out what to use for libcompat .include "$S/compat/common/Makefile.inc" .ifndef PROF LIBCOMPAT= ${COMPATLIB} .else LIBCOMPAT= ${COMPATLIB_PROF} .endif # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file # is marked as config-dependent. NORMAL_C= ${CC} -c ${CFLAGS} ${CPPFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} $< DRIVER_C= ${CC} -c ${CFLAGS} ${CPPFLAGS} ${PROF} $< DRIVER_C_C= ${CC} -c ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} $< PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \ sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ ${AS} -o $@; \ rm -f $*.s NORMAL_S= ${CC} -E ${CFLAGS} ${CPPFLAGS} $< | ${AS} -o $@ NORMAL_S_C= ${CC} -E ${CFLAGS} ${CPPFLAGS} ${PARAM} $< | ${AS} -o $@ %OBJS %CFILES # load lines for config "xxx" will be emitted as: # xxx: ${SYSTEM_DEP} swapxxx.o # ${SYSTEM_LD_HEAD} # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} # Kernel is linked as a ZMAGIC executable, with start at 10020 SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o \ ${LIBKERN} ${LIBCOMPAT} SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= -@if [ X${DEBUG} = X-g ]; \ then strip=-X; \ else strip=-x; \ fi; \ echo ${LD} $$strip -Ttext 0x10000 -o $@ ${SYSTEM_OBJ} libgcc.a vers.o; \ ${LD} $$strip -Ttext 0x10000 -e start -o $@ ${SYSTEM_OBJ} \ libgcc.a vers.o SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ [ X${DEBUG} = X-g ] && { \ echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ echo strip -d $@; strip -d $@; } || true %LOAD assym.s: genassym ./genassym >assym.s genassym: ${HOSTCC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmvme88k -Dm88k \ -o genassym ${MVME88K}/mvme88k/genassym.c vers.o: newvers newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c clean:: rm -f eddep *bsd bsd.gdb tags *.o locore.i \ [a-z]*.s [Ee]rrs errs linterrs makelinks lint: /tmp param.c @lint -hbxn -DGENERIC -Dvolatile= ${CFLAGS} ${CPPFLAGS} ${PARAM} -UKGDB \ ${CFILES} ${MVME88K}/mvme88k/swapgeneric.c ioconf.c param.c| \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' locore.o: assym.s ${MVME88K}/mvme88k/eh.S ${MVME88K}/mvme88k/locore.S locore.o: machine/trap.h machine/psl.h machine/cpu.h ${CPP} -DLOCORE ${CPPFLAGS} ${MVME88K}/mvme88k/locore.S | ${AS} -o locore.o # depend on root or device configuration autoconf.o conf.o: Makefile # depend on network or filesystem configuration uipc_domain.o uipc_proto.o vfs_conf.o: Makefile if_tun.o if_loop.o if_ethersubr.o: Makefile in_proto.o: Makefile # depend on maxusers genassym.o machdep.o: Makefile # depend on CPU configuration locore.o machdep.o: Makefile depend:: .depend .depend: assym.s param.c vnode_if.h mkdep ${CFLAGS} ${CPPFLAGS} ${CFILES} ioconf.c param.c mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${MVME88K}/mvme88k/genassym.c links: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ sort -u | comm -23 - dontlink | \ sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks sh makelinks && rm -f dontlink tags: @echo "see $S/kern/Makefile for tags" param.c: $S/conf/param.c rm -f param.c cp $S/conf/param.c . param.o: param.c Makefile ${NORMAL_C_C} ioconf.o: ioconf.c ${NORMAL_C} %RULES