1 1.18.14.1 tls # $NetBSD: Makefile.inc,v 1.18.14.2 2017/12/03 11:36:46 jdolecek Exp $ 2 1.1 fredette 3 1.18.14.2 jdolecek NOSSP= # defined 4 1.18.14.2 jdolecek NOPIE= # defined 5 1.1 fredette # Must have S=/usr/src/sys (or equivalent) 6 1.1 fredette # But note: this is w.r.t. a subdirectory 7 1.1 fredette S= ${.CURDIR}/../../../.. 8 1.1 fredette 9 1.1 fredette .if defined(SA_PROG) 10 1.1 fredette 11 1.1 fredette .include <bsd.own.mk> 12 1.1 fredette 13 1.18 tsutsui WARNS?= 2 14 1.18 tsutsui 15 1.1 fredette LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR} 16 1.1 fredette 17 1.1 fredette MDEC_DIR?=/usr/mdec 18 1.1 fredette 19 1.18.14.1 tls .if ${MACHINE} == "sun3" 20 1.18.14.1 tls RELOC?= 280000 21 1.18.14.1 tls .else 22 1.1 fredette RELOC?= 240000 23 1.18.14.1 tls .endif 24 1.8 tsutsui DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t 25 1.1 fredette INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} 26 1.1 fredette 27 1.18.14.2 jdolecek .if defined(HAVE_GCC) 28 1.18.14.1 tls # gcc 4.8 convers -mc68000 to -mcpu=68000 and that breaks gas 29 1.18.14.1 tls # which works for -march=68010 but breaks for -mcpu=68010 30 1.18.14.1 tls CPUFLAGS= -march=68010 31 1.18.14.1 tls .else 32 1.12 tsutsui CPUFLAGS= -mc68000 -Wa,-mc68010 33 1.18.14.1 tls .endif 34 1.18.14.1 tls COPTS= -Os -fno-defer-pop -ffreestanding -fno-unwind-tables 35 1.12 tsutsui CFLAGS= -msoft-float 36 1.12 tsutsui CPPFLAGS= ${DEFS} ${DEBUG} ${INCL} 37 1.1 fredette 38 1.1 fredette SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o 39 1.16 tsutsui SRTLIB= ${LIBSA}/lib/sa/libsa.a ${LIBSA}/lib/kern/libkern.a 40 1.1 fredette 41 1.1 fredette CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin 42 1.1 fredette 43 1.1 fredette # Make a copy of the executable with its ELF headers removed. 44 1.1 fredette ${SA_PROG}.bin : ${SA_PROG} 45 1.1 fredette ${OBJCOPY} --output-target=binary ${SA_PROG} $@ 46 1.1 fredette 47 1.1 fredette ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB} 48 1.3 lukem ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \ 49 1.18.14.1 tls ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB} 50 1.1 fredette @${SIZE} $@ 51 1.1 fredette 52 1.1 fredette .if !target(proginstall) 53 1.1 fredette realall: ${SA_PROG} ${SA_PROG}.bin 54 1.1 fredette proginstall: ${SA_PROG}.bin 55 1.2 lukem ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 56 1.2 lukem ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG} 57 1.1 fredette .endif 58 1.1 fredette 59 1.1 fredette .endif # defined(SA_PROG) 60 1.1 fredette 61 1.15 tsutsui .include <bsd.klinks.mk> 62 1.17 tsutsui 63 1.17 tsutsui # XXX SHOULD NOT NEED TO DEFINE THESE! 64 1.17 tsutsui LIBCRT0= 65 1.18.14.1 tls LIBCRTI= 66 1.17 tsutsui LIBC= 67 1.17 tsutsui LIBCRTBEGIN= 68 1.17 tsutsui LIBCRTEND= 69