Drop main() prototype. Syncs with NetBSD-8
[minix.git] / sys / arch / i386 / stand / cdboot / Makefile
blob2222458ac8f6ffec39d0b177aedcde28b67b0fe5
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:}
6 .if defined(__MINIX)
7 USE_BITCODE=no
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 LIBCRTI= # nothing
21 LIBCRTBEGIN= # nothing
22 LIBCRTEND= # nothing
23 LIBC= # nothing
25 PRIMARY_LOAD_ADDRESS= 0x1000
26 SECONDARY_LOAD_ADDRESS= 0x10000
28 PROG= bootxx_cd9660
29 SRCS?= cdboot.S
31 BINDIR= /usr/mdec
32 BINMODE= 444
34 .PATH: ${.CURDIR}/..
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
44 AFLAGS+= -m32
45 .endif
47 BUILDSYMLINKS+= $S/arch/i386/include machine \
48 $S/arch/x86/include x86
50 DPSRCS+= machine x86
52 CLEANFILES+= ${PROG}.tmp
54 ${PROG}: ${OBJS}
55 ${_MKTARGET_LINK}
56 .if defined(__MINIX)
57 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,--section-start=.text=${PRIMARY_LOAD_ADDRESS} \
58 ${OBJS}
59 .else
60 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \
61 ${OBJS}
62 .endif
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}
67 rm -f ${PROG}.tmp
69 .include <bsd.prog.mk>