unstack - fix ipcvecs
[minix.git] / sys / arch / i386 / stand / cdboot / Makefile
blob8e164cdeedbcb260e816460f0caba4f4099e89b4
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 STRIPFLAG= # nothing
12 LIBCRT0= # nothing
13 LIBCRTBEGIN= # nothing
14 LIBCRTEND= # nothing
15 LIBC= # nothing
17 PRIMARY_LOAD_ADDRESS= 0x1000
18 SECONDARY_LOAD_ADDRESS= 0x10000
20 PROG= bootxx_cd9660
21 SRCS?= cdboot.S
23 BINDIR= /usr/mdec
24 BINMODE= 444
26 .PATH: ${.CURDIR}/..
28 LDFLAGS+= -nostdlib -Wl,-e,start
29 #CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S}
30 CPPFLAGS+= -I. -I${.CURDIR}/../lib
31 CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS}
32 CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
33 CPPFLAGS+= -DDISABLE_KEYPRESS
35 .if ${MACHINE_ARCH} == "x86_64"
36 LDFLAGS+= -Wl,-m,elf_i386
37 AFLAGS+= -m32
38 .endif
40 .if defined(_NetBSD_)
41 # NetBSD can be compiled from a foreign host, MINIX do not. So commented out.
42 # Make sys/ a local thing for benefit of cross-compilers
43 CPPFLAGS+= -I${S}
44 # And same for machine/; need a bit more work because of symlink
45 BUILDSYMLINKS+= $S/arch/i386/include machine \
46 $S/arch/x86/include x86
48 DPSRCS+= machine x86
49 .endif
51 AFLAGS+= -Wa,--divide
53 CLEANFILES+= ${PROG}.tmp
55 ${PROG}: ${OBJS}
56 ${_MKTARGET_LINK}
57 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \
58 ${OBJS}
59 @ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'free_space' \
60 | ${TOOL_SED} 's/^0*//' ); \
61 echo "#### There are $$1 free bytes in ${PROG}"
62 ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
63 rm -f ${PROG}.tmp
65 .include <bsd.prog.mk>