2003-12-26 00:02:58 +03:00
|
|
|
# $NetBSD: Makefile,v 1.14 2003/12/25 21:02:58 jmc Exp $
|
1996-08-26 03:38:57 +04:00
|
|
|
|
1996-09-09 22:07:40 +04:00
|
|
|
CPPFLAGS= ${APMCPPFLAGS}
|
1998-09-01 03:52:40 +04:00
|
|
|
KSRC=${.CURDIR}/../../..
|
|
|
|
ARCHSRC=${.CURDIR}/../..
|
|
|
|
I386=${KSRC}/arch/i386
|
2003-12-26 00:02:58 +03:00
|
|
|
X86=${KSRC}/arch/x86
|
2001-12-14 23:32:23 +03:00
|
|
|
CPPFLAGS+=-I${ARCHSRC} -I${KSRC} -I${.CURDIR} -I${.OBJDIR} -D_LKM
|
1996-08-26 03:38:57 +04:00
|
|
|
|
1996-09-09 22:07:40 +04:00
|
|
|
SRCS= biostramp.S
|
|
|
|
OBJS= biostramp.o
|
|
|
|
DEPS= ${APMDEPS}
|
2000-02-01 08:25:24 +03:00
|
|
|
STRIP?= strip
|
1996-09-13 04:02:36 +04:00
|
|
|
|
|
|
|
all: biostramp.inc
|
1996-08-26 03:38:57 +04:00
|
|
|
|
1999-09-05 02:25:51 +04:00
|
|
|
biostramp.inc: biostramp.bin Makefile
|
2001-12-14 23:32:23 +03:00
|
|
|
@([ -f biostramp.inc ] && mv -f biostramp.inc biostramp.inc.bak; exit 0)
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${.CURDIR}/bin2asm.sh biostramp.bin > biostramp.inc
|
1999-09-05 02:25:51 +04:00
|
|
|
|
2001-12-14 23:32:23 +03:00
|
|
|
machine:
|
|
|
|
@rm -f machine && ln -s ${I386}/include machine
|
|
|
|
|
2003-12-26 00:02:58 +03:00
|
|
|
x86:
|
|
|
|
@rm -f x86 && ln -s ${X86}/include x86
|
|
|
|
|
1999-09-05 02:25:51 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
.if ${OBJECT_FMT} == "ELF"
|
|
|
|
biostramp.bin: biostramp.obj
|
2001-09-22 07:34:17 +04:00
|
|
|
${OBJCOPY} --output-target=binary $? $@
|
1999-09-05 02:25:51 +04:00
|
|
|
.else
|
|
|
|
biostramp.bin: biostramp.obj
|
|
|
|
cp $? $@
|
2000-02-01 08:25:24 +03:00
|
|
|
@${STRIP} $@
|
2003-10-26 10:25:33 +03:00
|
|
|
@${HOST_SH} ${.CURDIR}/rmaouthdr $@ $@.tmp
|
1999-09-05 02:25:51 +04:00
|
|
|
@if [ `ls -l $@.tmp |awk '{print $$5}'` -gt 4096 ]; then \
|
|
|
|
echo "$@ too big"; \
|
1996-09-08 19:36:51 +04:00
|
|
|
exit 1; \
|
|
|
|
fi
|
1999-09-05 02:25:51 +04:00
|
|
|
@mv -f $@.tmp $@
|
|
|
|
.endif
|
|
|
|
|
|
|
|
biostramp.obj: ${OBJS} ${DEPS}
|
2001-12-14 23:32:23 +03:00
|
|
|
${LD} -Bstatic -N -Ttext 0 -e do_bios_call -o $@ $(OBJS)
|
1996-08-26 03:38:57 +04:00
|
|
|
|
2003-12-26 00:02:58 +03:00
|
|
|
assym.h: machine x86 ${KSRC}/kern/genassym.sh genassym.cf
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${KSRC}/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
2001-12-14 23:32:23 +03:00
|
|
|
< ${.CURDIR}/genassym.cf > assym.h.tmp && \
|
1998-09-01 03:52:40 +04:00
|
|
|
mv -f assym.h.tmp assym.h
|
1996-09-13 04:02:36 +04:00
|
|
|
|
|
|
|
biostramp.S: assym.h
|
2001-12-14 23:32:23 +03:00
|
|
|
|
1996-09-13 04:02:36 +04:00
|
|
|
biostramp.o: biostramp.S
|
2001-12-14 23:32:23 +03:00
|
|
|
${CC} ${CPPFLAGS} -DASM -D_LOCORE -c ${.IMPSRC}
|
1996-09-13 04:02:36 +04:00
|
|
|
|
1996-08-26 03:38:57 +04:00
|
|
|
clean:
|
2001-12-14 23:32:23 +03:00
|
|
|
rm -f *.o biostramp.obj biostramp.bin biostramp.sym biostramp.inc \
|
|
|
|
assym.h biostramp.inc.bak machine
|
1996-08-26 03:38:57 +04:00
|
|
|
|
1996-09-09 22:07:40 +04:00
|
|
|
.include <bsd.dep.mk>
|
|
|
|
.include <bsd.subdir.mk>
|
2001-12-14 23:32:23 +03:00
|
|
|
.include <bsd.obj.mk>
|