1 # $NetBSD: Makefile,v 1.13 2013/09/12 05:54:38 joerg Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
5 AFLAGS.cdboot.S
= ${${ACTIVE_CC} == "clang":?
-no-integrated-as
:}
7 AFLAGS.cdboot.S
+= -Wa
,--divide
8 .
endif # defined(__MINIX)
20 LIBCRTBEGIN
= # nothing
24 PRIMARY_LOAD_ADDRESS
= 0x1000
25 SECONDARY_LOAD_ADDRESS
= 0x10000
35 LDFLAGS
+= -nostdlib
-Wl
,-e
,start
36 CPPFLAGS
+= -I.
-I
${.CURDIR
}/..
/lib
-I
${S}
37 CPPFLAGS
+= -DPRIMARY_LOAD_ADDRESS
=${PRIMARY_LOAD_ADDRESS}
38 CPPFLAGS
+= -DSECONDARY_LOAD_ADDRESS
=${SECONDARY_LOAD_ADDRESS}
39 CPPFLAGS
+= -DDISABLE_KEYPRESS
41 .if
${MACHINE_ARCH} == "x86_64"
42 LDFLAGS
+= -Wl
,-m
,elf_i386
46 BUILDSYMLINKS
+= $S/arch
/i386
/include machine \
47 $S/arch
/x86
/include x86
51 CLEANFILES
+= ${PROG}.tmp
56 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,--section-start
=.text
=${PRIMARY_LOAD_ADDRESS} \
59 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,-Ttext
,${PRIMARY_LOAD_ADDRESS} \
62 @ set
-- $$( ${NM} -t d
${PROG}.tmp | grep
'\<free_space\>' \
63 |
${TOOL_SED} 's/^0*//' ); \
64 echo
"#### There are $$1 free bytes in ${PROG}"
65 ${OBJCOPY} -O binary
${PROG}.tmp
${PROG}
68 .
include <bsd.prog.mk
>