1 1.17 tsutsui # $NetBSD: Makefile.inc,v 1.17 2011/05/29 10:06:34 tsutsui Exp $ 2 1.1 fredette 3 1.1 fredette # Must have S=/usr/src/sys (or equivalent) 4 1.1 fredette # But note: this is w.r.t. a subdirectory 5 1.1 fredette S= ${.CURDIR}/../../../.. 6 1.1 fredette 7 1.1 fredette .if defined(SA_PROG) 8 1.1 fredette 9 1.1 fredette .include <bsd.own.mk> 10 1.1 fredette 11 1.1 fredette LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR} 12 1.1 fredette 13 1.1 fredette MDEC_DIR?=/usr/mdec 14 1.1 fredette 15 1.1 fredette RELOC?= 240000 16 1.8 tsutsui DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t 17 1.1 fredette INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} 18 1.1 fredette 19 1.12 tsutsui CPUFLAGS= -mc68000 -Wa,-mc68010 20 1.12 tsutsui COPTS= -Os -fno-defer-pop -ffreestanding 21 1.12 tsutsui CFLAGS= -msoft-float 22 1.14 tsutsui CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 23 1.12 tsutsui CPPFLAGS= ${DEFS} ${DEBUG} ${INCL} 24 1.1 fredette 25 1.1 fredette SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o 26 1.16 tsutsui SRTLIB= ${LIBSA}/lib/sa/libsa.a ${LIBSA}/lib/kern/libkern.a 27 1.1 fredette 28 1.1 fredette CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin 29 1.1 fredette 30 1.1 fredette # Make a copy of the executable with its ELF headers removed. 31 1.1 fredette ${SA_PROG}.bin : ${SA_PROG} 32 1.1 fredette ${OBJCOPY} --output-target=binary ${SA_PROG} $@ 33 1.1 fredette 34 1.1 fredette ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB} 35 1.3 lukem ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \ 36 1.1 fredette ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB} 37 1.1 fredette @${SIZE} $@ 38 1.1 fredette 39 1.1 fredette .if !target(proginstall) 40 1.1 fredette realall: ${SA_PROG} ${SA_PROG}.bin 41 1.1 fredette proginstall: ${SA_PROG}.bin 42 1.2 lukem ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 43 1.2 lukem ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG} 44 1.1 fredette .endif 45 1.1 fredette 46 1.1 fredette .endif # defined(SA_PROG) 47 1.1 fredette 48 1.15 tsutsui .include <bsd.klinks.mk> 49 1.17 tsutsui 50 1.17 tsutsui # XXX SHOULD NOT NEED TO DEFINE THESE! 51 1.17 tsutsui LIBCRT0= 52 1.17 tsutsui LIBC= 53 1.17 tsutsui LIBCRTBEGIN= 54 1.17 tsutsui LIBCRTEND= 55