Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / i386 / stand / cdboot / Makefile
blob30b479044f2f04eb5a86c18ff12a29ddc5719044
1 # $NetBSD: Makefile,v 1.8 2008/10/25 22:27:37 apb Exp $
3 S= ${.CURDIR}/../../../..
5 NOMAN= # defined
6 STRIPFLAG= # nothing
8 LIBCRT0= # nothing
9 LIBCRTBEGIN= # nothing
10 LIBCRTEND= # nothing
11 LIBC= # nothing
13 PRIMARY_LOAD_ADDRESS=0x600
14 SECONDARY_LOAD_ADDRESS=0x10000
16 PIE_CFLAGS=
17 PIE_LDFLAGS=
18 PIE_AFLAGS=
20 .include <bsd.own.mk>
22 PROG= cdboot
23 SRCS?= cdboot.S
25 BINDIR= /usr/mdec
26 BINMODE=444
28 .PATH: ${.CURDIR}/..
30 LDFLAGS+= -nostdlib -Wl,-e,start
31 CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S}
32 CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS}
33 CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
34 #CPPFLAGS+= -DDISABLE_KEYPRESS
36 .if ${MACHINE_ARCH} == "x86_64"
37 LDFLAGS+= -Wl,-m,elf_i386
38 AFLAGS+= -m32
39 .endif
41 .if !make(obj) && !make(clean) && !make(cleandir)
42 .BEGIN: machine x86
43 .NOPATH: machine x86
44 .endif
46 realdepend realall: machine x86
47 CLEANFILES+= machine x86
49 machine::
50 -rm -f $@
51 ln -s $S/arch/i386/include $@
53 x86::
54 -rm -f $@
55 ln -s $S/arch/x86/include $@
57 ${OBJS}: machine x86
59 CLEANFILES+= ${PROG}.tmp
61 ${PROG}: ${OBJS}
62 ${_MKTARGET_LINK}
63 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} ${OBJS}
64 @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<free_space\>' \
65 | ${TOOL_SED} 's/^0*//' ); \
66 echo "#### There are $$1 free bytes in ${PROG}"
67 ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
68 rm -f ${PROG}.tmp
70 .include <bsd.prog.mk>