1 # $NetBSD: Makefile,v 1.12 2011/05/20 22:29:55 joerg Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
5 AFLAGS.cdboot.S
= ${${ACTIVE_CC} == "clang":?
-no-integrated-as
:}
13 LIBCRTBEGIN
= # nothing
17 PRIMARY_LOAD_ADDRESS
= 0x1000
18 SECONDARY_LOAD_ADDRESS
= 0x10000
28 LDFLAGS
+= -nostdlib
-Wl
,-e
,start
29 #CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S}
30 CPPFLAGS
+= -I.
-I
${.CURDIR
}/..
/lib
31 CPPFLAGS
+= -DPRIMARY_LOAD_ADDRESS
=${PRIMARY_LOAD_ADDRESS}
32 CPPFLAGS
+= -DSECONDARY_LOAD_ADDRESS
=${SECONDARY_LOAD_ADDRESS}
33 CPPFLAGS
+= -DDISABLE_KEYPRESS
35 .if
${MACHINE_ARCH} == "x86_64"
36 LDFLAGS
+= -Wl
,-m
,elf_i386
41 # NetBSD can be compiled from a foreign host, MINIX do not. So commented out.
42 # Make sys/ a local thing for benefit of cross-compilers
44 # And same for machine/; need a bit more work because of symlink
45 BUILDSYMLINKS
+= $S/arch
/i386
/include machine \
46 $S/arch
/x86
/include x86
53 CLEANFILES
+= ${PROG}.tmp
57 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,-Ttext
,${PRIMARY_LOAD_ADDRESS} \
59 @ set
-- $$( ${NM} -t d
${PROG}.tmp | grep
'free_space' \
60 |
${TOOL_SED} 's/^0*//' ); \
61 echo
"#### There are $$1 free bytes in ${PROG}"
62 ${OBJCOPY} -O binary
${PROG}.tmp
${PROG}
65 .
include <bsd.prog.mk
>