1997-02-05 20:31:46 +03:00
|
|
|
# $NetBSD: Makefile.inc,v 1.7 1997/02/05 17:31:46 gwr Exp $
|
1995-02-15 01:56:36 +03:00
|
|
|
|
|
|
|
.if defined(SA_PROG)
|
|
|
|
|
|
|
|
# Must have S=/usr/src/sys (or equivalent)
|
|
|
|
# But note: this is w.r.t. a subdirectory
|
1995-08-09 01:02:04 +04:00
|
|
|
S= ${.CURDIR}/../../../..
|
1995-02-15 01:56:36 +03:00
|
|
|
|
|
|
|
RELOC?= 240000
|
1997-02-05 20:31:46 +03:00
|
|
|
DEFS?= -Dsun3 -DSTANDALONE
|
1995-08-09 01:02:04 +04:00
|
|
|
INCL?= -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S}
|
1995-11-18 02:23:44 +03:00
|
|
|
COPTS?= -msoft-float ${DEFS} ${DBG} ${INCL}
|
1995-02-15 01:56:36 +03:00
|
|
|
|
|
|
|
LIBSA?= ../libsa
|
|
|
|
SRTOBJ?= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o
|
1995-11-18 02:23:44 +03:00
|
|
|
SRTLIB?= ${LIBSA}/libsa.a
|
|
|
|
|
1995-06-10 02:03:41 +04:00
|
|
|
MDEC_DIR?=/usr/mdec
|
1995-02-15 01:56:36 +03:00
|
|
|
|
|
|
|
SRCS?= ${SA_PROG}.c
|
1995-09-23 07:42:17 +04:00
|
|
|
OBJS?= ${SRCS:S/.c/.o/g}
|
1995-02-15 01:56:36 +03:00
|
|
|
|
1995-10-14 00:44:08 +03:00
|
|
|
CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin
|
|
|
|
|
|
|
|
# Make a copy of the executable with its exec header removed,
|
|
|
|
# and with its length padded to a multiple of 1k bytes.
|
|
|
|
# (The padding is for convenience when making tapes.)
|
1995-06-10 02:03:41 +04:00
|
|
|
${SA_PROG}.bin : ${SA_PROG}
|
|
|
|
cp ${SA_PROG} a.out ; strip a.out
|
1995-10-14 00:44:08 +03:00
|
|
|
dd if=a.out ibs=32 skip=1 of=$@ obs=1k conv=osync
|
1995-06-10 02:03:41 +04:00
|
|
|
-rm -f a.out
|
1995-02-15 01:56:36 +03:00
|
|
|
|
1995-11-18 02:23:44 +03:00
|
|
|
${SA_PROG} : ${OBJS} ${DPADD}
|
|
|
|
${LD} -N -T ${RELOC} -e start -o $@ \
|
|
|
|
${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB}
|
1995-02-15 01:56:36 +03:00
|
|
|
@size $@
|
|
|
|
|
1995-06-10 02:03:41 +04:00
|
|
|
.if !target(clean)
|
|
|
|
clean:
|
|
|
|
-rm -f a.out [Ee]rrs mklog core *.core
|
1995-10-14 00:44:08 +03:00
|
|
|
-rm -f ${CLEANFILES} *.o
|
1995-06-10 02:03:41 +04:00
|
|
|
.endif
|
|
|
|
|
1995-11-18 02:23:44 +03:00
|
|
|
.if !target(install)
|
|
|
|
install: ${SA_PROG}.bin
|
|
|
|
install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
|
|
${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG}
|
|
|
|
.endif
|
|
|
|
|
1995-02-15 01:56:36 +03:00
|
|
|
.endif
|