1 # $NetBSD: Makefile,v 1.8 2008/10/25 22:27:37 apb Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
13 PRIMARY_LOAD_ADDRESS
=0x600
14 SECONDARY_LOAD_ADDRESS
=0x10000
30 LDFLAGS
+= -nostdlib
-Wl
,-e
,start
31 CPPFLAGS
+= -I.
-I
${.CURDIR
}/..
/lib
-I
${S}
32 CPPFLAGS
+= -DPRIMARY_LOAD_ADDRESS
=${PRIMARY_LOAD_ADDRESS}
33 CPPFLAGS
+= -DSECONDARY_LOAD_ADDRESS
=${SECONDARY_LOAD_ADDRESS}
34 #CPPFLAGS+= -DDISABLE_KEYPRESS
36 .if
${MACHINE_ARCH} == "x86_64"
37 LDFLAGS
+= -Wl
,-m
,elf_i386
41 .if
!make
(obj
) && !make
(clean) && !make
(cleandir
)
46 realdepend realall
: machine x86
47 CLEANFILES
+= machine x86
51 ln
-s
$S/arch
/i386
/include $@
55 ln
-s
$S/arch
/x86
/include $@
59 CLEANFILES
+= ${PROG}.tmp
63 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,-Ttext
,${PRIMARY_LOAD_ADDRESS} ${OBJS}
64 @ set
-- $$( ${NM} -t d
${PROG}.tmp | grep
'\<free_space\>' \
65 |
${TOOL_SED} 's/^0*//' ); \
66 echo
"#### There are $$1 free bytes in ${PROG}"
67 ${OBJCOPY} -O binary
${PROG}.tmp
${PROG}
70 .
include <bsd.prog.mk
>