1 # $NetBSD: Makefile,v 1.14 2014/01/12 15:26:29 tsutsui Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
5 AFLAGS.cdboot.S
= ${${ACTIVE_CC} == "clang":?
-no-integrated-as
:}
8 .
endif # defined(__MINIX)
21 LIBCRTBEGIN
= # nothing
25 PRIMARY_LOAD_ADDRESS
= 0x1000
26 SECONDARY_LOAD_ADDRESS
= 0x10000
36 LDFLAGS
+= -nostdlib
-Wl
,-e
,start
37 CPPFLAGS
+= -I.
-I
${.CURDIR
}/..
/lib
-I
${S}
38 CPPFLAGS
+= -DPRIMARY_LOAD_ADDRESS
=${PRIMARY_LOAD_ADDRESS}
39 CPPFLAGS
+= -DSECONDARY_LOAD_ADDRESS
=${SECONDARY_LOAD_ADDRESS}
40 CPPFLAGS
+= -DDISABLE_KEYPRESS
42 .if
${MACHINE_ARCH} == "x86_64"
43 LDFLAGS
+= -Wl
,-m
,elf_i386
47 BUILDSYMLINKS
+= $S/arch
/i386
/include machine \
48 $S/arch
/x86
/include x86
52 CLEANFILES
+= ${PROG}.tmp
57 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,--section-start
=.text
=${PRIMARY_LOAD_ADDRESS} \
60 ${CC} -o
${PROG}.tmp
${LDFLAGS} -Wl
,-Ttext
,${PRIMARY_LOAD_ADDRESS} \
63 @ set
-- $$( ${NM} -t d
${PROG}.tmp | grep
'\<free_space\>' \
64 |
${TOOL_SED} 's/^0*//' ); \
65 echo
"#### There are $$1 free bytes in ${PROG}"
66 ${OBJCOPY} -O binary
${PROG}.tmp
${PROG}
69 .
include <bsd.prog.mk
>