tools/llvm: Do not build with symbols
[minix3.git] / sys / arch / i386 / stand / cdboot / Makefile
bloba3b357dd1cfd5c41efa8ee2cc1a4552646cbc67e
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:}
6 .if defined(__MINIX)
7 AFLAGS.cdboot.S+= -Wa,--divide
8 .endif # defined(__MINIX)
10 PIE_CFLAGS=
11 PIE_LDFLAGS=
12 PIE_AFLAGS=
14 NOMAN= # defined
15 .include <bsd.own.mk>
17 STRIPFLAG= # nothing
19 LIBCRT0= # nothing
20 LIBCRTBEGIN= # nothing
21 LIBCRTEND= # nothing
22 LIBC= # nothing
24 PRIMARY_LOAD_ADDRESS= 0x1000
25 SECONDARY_LOAD_ADDRESS= 0x10000
27 PROG= bootxx_cd9660
28 SRCS?= cdboot.S
30 BINDIR= /usr/mdec
31 BINMODE= 444
33 .PATH: ${.CURDIR}/..
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
43 AFLAGS+= -m32
44 .endif
46 BUILDSYMLINKS+= $S/arch/i386/include machine \
47 $S/arch/x86/include x86
49 DPSRCS+= machine x86
51 CLEANFILES+= ${PROG}.tmp
53 ${PROG}: ${OBJS}
54 ${_MKTARGET_LINK}
55 .if defined(__MINIX)
56 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,--section-start=.text=${PRIMARY_LOAD_ADDRESS} \
57 ${OBJS}
58 .else
59 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \
60 ${OBJS}
61 .endif
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}
66 rm -f ${PROG}.tmp
68 .include <bsd.prog.mk>