sprofalyze fixes
[minix.git] / sys / arch / i386 / stand / cdboot / Makefile
blob09704f161b6341ac4d2cad213c2f3c01da9c6a72
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:}
7 NOMAN= # defined
8 .include <bsd.own.mk>
10 .if defined(__MINIX)
11 AFLAGS+= -Wa,--divide
12 .endif
14 STRIPFLAG= # nothing
16 LIBCRT0= # nothing
17 LIBCRTBEGIN= # nothing
18 LIBCRTEND= # nothing
19 LIBC= # nothing
21 PRIMARY_LOAD_ADDRESS= 0x1000
22 SECONDARY_LOAD_ADDRESS= 0x10000
24 PROG= bootxx_cd9660
25 SRCS?= cdboot.S
27 BINDIR= /usr/mdec
28 BINMODE= 444
30 .PATH: ${.CURDIR}/..
32 LDFLAGS+= -nostdlib -Wl,-e,start
33 CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S}
34 CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS}
35 CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
36 CPPFLAGS+= -DDISABLE_KEYPRESS
38 .if ${MACHINE_ARCH} == "x86_64"
39 LDFLAGS+= -Wl,-m,elf_i386
40 AFLAGS+= -m32
41 .endif
43 BUILDSYMLINKS+= $S/arch/i386/include machine \
44 $S/arch/x86/include x86
46 DPSRCS+= machine x86
48 CLEANFILES+= ${PROG}.tmp
50 ${PROG}: ${OBJS}
51 ${_MKTARGET_LINK}
52 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \
53 ${OBJS}
54 @ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'free_space' \
55 | ${TOOL_SED} 's/^0*//' ); \
56 echo "#### There are $$1 free bytes in ${PROG}"
57 ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
58 rm -f ${PROG}.tmp
60 .include <bsd.prog.mk>