1 # $NetBSD: Makefile.inc,v 1.15 2009/03/15 14:08:17 tsutsui Exp $
3 # Must have S=/usr/src/sys (or equivalent)
4 # But note: this is w.r.t. a subdirectory
5 S= ${.CURDIR}/../../../..
11 LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR}
16 DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t
17 INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S}
19 CPUFLAGS= -mc68000 -Wa,-mc68010
20 COPTS= -Os -fno-defer-pop -ffreestanding
22 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
23 CPPFLAGS= ${DEFS} ${DEBUG} ${INCL}
25 SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o
26 SRTLIB= ${LIBSA}/lib/sa/libsa.a ${LIBSA}/lib/kern/libkern.a
28 CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin
30 # Make a copy of the executable with its ELF headers removed.
31 ${SA_PROG}.bin : ${SA_PROG}
32 ${OBJCOPY} --output-target=binary ${SA_PROG} $@
34 ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB}
35 ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \
36 ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB}
39 .if !target(proginstall)
40 realall: ${SA_PROG} ${SA_PROG}.bin
41 proginstall: ${SA_PROG}.bin
42 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
43 ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG}
46 .endif # defined(SA_PROG)
48 .include <bsd.klinks.mk>