1 # $NetBSD: Makefile.inc,v 1.4 2002/06/03 00:29:05 fredette Exp $ 2 3 # Must have S=/usr/src/sys (or equivalent) 4 # But note: this is w.r.t. a subdirectory 5 S= ${.CURDIR}/../../../.. 6 7 .if defined(SA_PROG) 8 9 .include <bsd.own.mk> 10 11 LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR} 12 13 MDEC_DIR?=/usr/mdec 14 15 RELOC?= 240000 16 DEFS?= -Dsun3 -D_STANDALONE 17 INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} 18 19 CFLAGS= -Os -msoft-float -fno-defer-pop 20 CPPFLAGS= ${DEFS} ${DBG} ${INCL} 21 22 SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o 23 SRTLIB= ${LIBSA}/libsa.a 24 25 CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin 26 27 # Make a copy of the executable with its ELF headers removed. 28 ${SA_PROG}.bin : ${SA_PROG} 29 ${OBJCOPY} --output-target=binary ${SA_PROG} $@ 30 31 ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB} 32 ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \ 33 ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB} 34 @${SIZE} $@ 35 36 .if !target(proginstall) 37 realall: ${SA_PROG} ${SA_PROG}.bin 38 proginstall: ${SA_PROG}.bin 39 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 40 ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG} 41 .endif 42 43 .endif # defined(SA_PROG) 44 45 CLEANFILES+= m68k sun68k 46 .BEGIN: machine m68k sun68k 47 .NOPATH: machine m68k sun68k 48 realall realdepend: machine m68k sun68k 49 50 machine : 51 -rm -rf $@ 52 mkdir $@ 53 ln -s ${S}/arch/sun3/include/mc68851.h $@ 54 ln -s ${S}/arch/sun3/include/param3.h $@ 55 ln -s ${S}/arch/sun3/include/param3x.h $@ 56 ln -s ${S}/arch/sun68k/include/loadfile_machdep.h $@ 57 58 m68k : 59 -rm -f $@ 60 ln -s ${S}/arch/m68k/include $@ 61 62 sun68k : 63 -rm -f $@ 64 ln -s ${S}/arch/sun68k $@ 65 66 clean : machineclean 67 68 machineclean : 69 -rm -rf machine 70