Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / i386 / bioscall / Makefile
blob81362971cde83a7e440bab820e6a4c7af5e4ad07
1 # $NetBSD: Makefile,v 1.17 2006/06/06 15:41:50 christos Exp $
3 CPPFLAGS= ${APMCPPFLAGS}
4 KSRC=${.CURDIR}/../../..
5 ARCHSRC=${.CURDIR}/../..
6 I386=${KSRC}/arch/i386
7 X86=${KSRC}/arch/x86
8 CPPFLAGS+=-I${ARCHSRC} -I${KSRC} -I${.CURDIR} -I${.OBJDIR} -D_LKM -D_KERNEL
10 SRCS= biostramp.S
11 OBJS= biostramp.o
12 DEPS= ${APMDEPS}
13 STRIP?= strip
14 TRAMP= ${.CURDIR}/biostramp.inc
16 all: ${TRAMP}
18 ${TRAMP}: biostramp.bin Makefile
19 @([ -f ${TRAMP} ] && mv -f ${TRAMP} ${TRAMP}.bak; exit 0)
20 ${HOST_SH} ${.CURDIR}/bin2asm.sh biostramp.bin > ${.TARGET}
22 machine:
23 @rm -f machine && ln -s ${I386}/include machine
25 x86:
26 @rm -f x86 && ln -s ${X86}/include x86
28 .include <bsd.own.mk>
30 .if ${OBJECT_FMT} == "ELF"
31 biostramp.bin: biostramp.obj
32 ${OBJCOPY} --output-target=binary $? $@
33 .else
34 biostramp.bin: biostramp.obj
35 cp $? $@
36 @${STRIP} $@
37 @${HOST_SH} ${.CURDIR}/rmaouthdr $@ $@.tmp
38 @if [ `ls -l $@.tmp | ${TOOL_AWK} '{print $$5}'` -gt 4096 ]; then \
39 echo "$@ too big"; \
40 exit 1; \
42 @mv -f $@.tmp $@
43 .endif
45 biostramp.obj: ${OBJS} ${DEPS}
46 ${LD} -Bstatic -N -Ttext 0 -e do_bios_call -o $@ $(OBJS)
48 assym.h: machine x86 genassym.cf
49 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
50 < ${.CURDIR}/genassym.cf > assym.h.tmp && \
51 mv -f assym.h.tmp assym.h
53 biostramp.S: assym.h
55 biostramp.o: biostramp.S
56 ${CC} ${CPPFLAGS} -DASM -D_LOCORE -c ${.IMPSRC}
58 clean:
59 rm -f *.o biostramp.obj biostramp.bin biostramp.sym ${TRAMP} \
60 assym.h ${TRAMP}.bak machine
62 .include <bsd.dep.mk>
63 .include <bsd.subdir.mk>
64 .include <bsd.obj.mk>