1 # $NetBSD: Makefile,v 1.11 2008/10/25 22:27:37 apb Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
/..
11 LIBCRTBEGIN
= # nothing
15 PRIMARY_LOAD_ADDRESS
= 0x600
16 SECONDARY_LOAD_ADDRESS
= 0x10000
24 .PATH
: ${.CURDIR
}/..
/..
${.CURDIR
}/..
/..
/cdboot
26 LDFLAGS
+= -nostdlib
-Wl
,-e
,start
27 CPPFLAGS
+= -I.
-I
${.CURDIR
}/..
/..
/lib
-I
${S}
28 CPPFLAGS
+= -DPRIMARY_LOAD_ADDRESS
=${PRIMARY_LOAD_ADDRESS}
29 CPPFLAGS
+= -DSECONDARY_LOAD_ADDRESS
=${SECONDARY_LOAD_ADDRESS}
30 CPPFLAGS
+= -DDISABLE_KEYPRESS
32 .if
${MACHINE_ARCH} == "x86_64"
33 LDFLAGS
+= -Wl
,-m
,elf_i386
37 BUILDSYMLINKS
+= $S/arch
/i386
/include machine \
38 $S/arch
/x86
/include x86
42 CLEANFILES
+= ${PROG}.tmp
46 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,-Ttext
,${PRIMARY_LOAD_ADDRESS} \
48 @ set
-- $$( ${NM} -t d
${PROG}.tmp | grep
'\<free_space\>' \
49 |
${TOOL_SED} 's/^0*//' ); \
50 echo
"#### There are $$1 free bytes in ${PROG}"
51 ${OBJCOPY} -O binary
${PROG}.tmp
${PROG}
54 .
include <bsd.prog.mk
>