2011-05-29 14:19:09 +04:00
|
|
|
# $NetBSD: Makefile.inc,v 1.18 2011/05/29 10:19:09 tsutsui Exp $
|
2001-06-14 16:57:10 +04:00
|
|
|
|
|
|
|
# Must have S=/usr/src/sys (or equivalent)
|
|
|
|
# But note: this is w.r.t. a subdirectory
|
|
|
|
S= ${.CURDIR}/../../../..
|
|
|
|
|
|
|
|
.if defined(SA_PROG)
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2011-05-29 14:19:09 +04:00
|
|
|
WARNS?= 2
|
|
|
|
|
2001-06-14 16:57:10 +04:00
|
|
|
LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR}
|
|
|
|
|
|
|
|
MDEC_DIR?=/usr/mdec
|
|
|
|
|
|
|
|
RELOC?= 240000
|
2003-11-30 08:32:39 +03:00
|
|
|
DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t
|
2001-06-14 16:57:10 +04:00
|
|
|
INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S}
|
|
|
|
|
2006-09-17 09:44:46 +04:00
|
|
|
CPUFLAGS= -mc68000 -Wa,-mc68010
|
|
|
|
COPTS= -Os -fno-defer-pop -ffreestanding
|
|
|
|
CFLAGS= -msoft-float
|
|
|
|
CPPFLAGS= ${DEFS} ${DEBUG} ${INCL}
|
2001-06-14 16:57:10 +04:00
|
|
|
|
|
|
|
SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o
|
2009-03-20 14:42:25 +03:00
|
|
|
SRTLIB= ${LIBSA}/lib/sa/libsa.a ${LIBSA}/lib/kern/libkern.a
|
2001-06-14 16:57:10 +04:00
|
|
|
|
|
|
|
CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin
|
|
|
|
|
|
|
|
# Make a copy of the executable with its ELF headers removed.
|
|
|
|
${SA_PROG}.bin : ${SA_PROG}
|
|
|
|
${OBJCOPY} --output-target=binary ${SA_PROG} $@
|
|
|
|
|
|
|
|
${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB}
|
2002-05-15 08:07:41 +04:00
|
|
|
${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \
|
2001-06-14 16:57:10 +04:00
|
|
|
${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB}
|
|
|
|
@${SIZE} $@
|
|
|
|
|
|
|
|
.if !target(proginstall)
|
|
|
|
realall: ${SA_PROG} ${SA_PROG}.bin
|
|
|
|
proginstall: ${SA_PROG}.bin
|
2002-02-09 12:35:59 +03:00
|
|
|
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
|
|
${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG}
|
2001-06-14 16:57:10 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif # defined(SA_PROG)
|
|
|
|
|
2009-03-15 17:08:17 +03:00
|
|
|
.include <bsd.klinks.mk>
|
2011-05-29 14:06:34 +04:00
|
|
|
|
|
|
|
# XXX SHOULD NOT NEED TO DEFINE THESE!
|
|
|
|
LIBCRT0=
|
|
|
|
LIBC=
|
|
|
|
LIBCRTBEGIN=
|
|
|
|
LIBCRTEND=
|