1 1.2.6.2 skrll # $NetBSD: Makefile,v 1.2.6.2 2005/11/10 13:56:53 skrll Exp $ 2 1.2.6.2 skrll 3 1.2.6.2 skrll S= ${.CURDIR}/../../../../../ 4 1.2.6.2 skrll 5 1.2.6.2 skrll NOMAN= # defined 6 1.2.6.2 skrll STRIPFLAG= # nothing 7 1.2.6.2 skrll 8 1.2.6.2 skrll LIBCRT0= # nothing 9 1.2.6.2 skrll LIBCRTBEGIN= # nothing 10 1.2.6.2 skrll LIBCRTEND= # nothing 11 1.2.6.2 skrll LIBC= # nothing 12 1.2.6.2 skrll 13 1.2.6.2 skrll PRIMARY_LOAD_ADDRESS=0x600 14 1.2.6.2 skrll SECONDARY_LOAD_ADDRESS=0x10000 15 1.2.6.2 skrll 16 1.2.6.2 skrll .include <bsd.own.mk> 17 1.2.6.2 skrll 18 1.2.6.2 skrll PROG= cdboot 19 1.2.6.2 skrll SRCS?= cdboot.S 20 1.2.6.2 skrll 21 1.2.6.2 skrll BINDIR= /usr/mdec 22 1.2.6.2 skrll BINMODE=444 23 1.2.6.2 skrll 24 1.2.6.2 skrll .PATH: ${.CURDIR}/.. 25 1.2.6.2 skrll 26 1.2.6.2 skrll LDFLAGS+= -e start 27 1.2.6.2 skrll CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S} 28 1.2.6.2 skrll CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} 29 1.2.6.2 skrll CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} 30 1.2.6.2 skrll #CPPFLAGS+= -DDISABLE_KEYPRESS 31 1.2.6.2 skrll 32 1.2.6.2 skrll .if ${MACHINE} == "amd64" 33 1.2.6.2 skrll LDFLAGS+= -m elf_i386 34 1.2.6.2 skrll AFLAGS+= -m32 35 1.2.6.2 skrll .endif 36 1.2.6.2 skrll 37 1.2.6.2 skrll .if !make(obj) && !make(clean) && !make(cleandir) 38 1.2.6.2 skrll .BEGIN: machine x86 39 1.2.6.2 skrll .NOPATH: machine x86 40 1.2.6.2 skrll .endif 41 1.2.6.2 skrll 42 1.2.6.2 skrll realdepend realall: machine x86 43 1.2.6.2 skrll CLEANFILES+= machine x86 44 1.2.6.2 skrll 45 1.2.6.2 skrll machine:: 46 1.2.6.2 skrll -rm -f $@ 47 1.2.6.2 skrll ln -s $S/arch/i386/include $@ 48 1.2.6.2 skrll 49 1.2.6.2 skrll x86:: 50 1.2.6.2 skrll -rm -f $@ 51 1.2.6.2 skrll ln -s $S/arch/x86/include $@ 52 1.2.6.2 skrll 53 1.2.6.2 skrll ${OBJS}: machine x86 54 1.2.6.2 skrll 55 1.2.6.2 skrll CLEANFILES+= ${PROG}.tmp 56 1.2.6.2 skrll 57 1.2.6.2 skrll ${PROG}: ${OBJS} 58 1.2.6.2 skrll ${LD} -o ${PROG}.tmp ${LDFLAGS} -Ttext ${PRIMARY_LOAD_ADDRESS} ${OBJS} 59 1.2.6.2 skrll @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<free_space\>' | sed 's/^0*//' ); \ 60 1.2.6.2 skrll echo "#### There are $$1 free bytes in ${PROG}" 61 1.2.6.2 skrll ${OBJCOPY} -O binary ${PROG}.tmp ${PROG} 62 1.2.6.2 skrll rm -f ${PROG}.tmp 63 1.2.6.2 skrll 64 1.2.6.2 skrll .include <bsd.prog.mk> 65