Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / x68k / stand / boot / Makefile
blob171b3fdc1c46a93fc409e24e67ca8478e2f62c39
1 # $NetBSD: Makefile,v 1.16 2009/01/12 07:56:31 tsutsui Exp $
3 NOMAN= # defined
5 .include <bsd.own.mk>
7 BOOT= Multi-boot
8 VERSIONFILE= ${.CURDIR}/version
9 VERSION!= ${TOOL_AWK} -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } \
10 END { print it }' ${VERSIONFILE}
11 NEWVERSWHAT= "${BOOT}"
13 # text address
14 TEXT= 006000
16 PROG= boot
17 BINDIR= /usr/mdec
18 BINMODE= 444
19 STRIPFLAG=
21 BFDNAME= a.out-m68k-netbsd
22 STRIP?= /usr/bin/strip
23 OBJCOPY?= /usr/bin/objcopy
25 SRCS= srt0.S boot.c conf.c exec_image.S
26 S= ${.CURDIR}/../../../..
27 M= ${.CURDIR}/../..
28 COMMONDIR= $M/stand/common
29 .PATH: ${COMMONDIR}
31 SRCS+= vers.c
32 CLEANFILES+= vers.c
33 vers.c: ${VERSIONFILE}
34 ${_MKTARGET_CREATE}
35 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.ALLSRC} ${MACHINE} ${NEWVERSWHAT}
37 CPPFLAGS+= -nostdinc -I$S -I${.OBJDIR} -I$M/stand/libsa
38 CPPFLAGS+= -I$M/stand/libiocs -I${COMMONDIR}
39 CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE
40 CPPFLAGS+= -DTEXTADDR="0x${TEXT}"
41 CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\"
42 CFLAGS= -Wno-main -Os -m68020-60
43 .if ${OBJECT_FMT} == "ELF"
44 LINKFLAGS= -N -static -T ${.CURDIR}/boot.ldscript
45 .else
46 LINKFLAGS= -N -static -Ttext ${TEXT}
47 .endif
48 LIBIOCS!= cd $M/stand/libiocs && ${PRINTOBJDIR}
49 LIBSA!= cd $M/stand/libsa && ${PRINTOBJDIR}
50 LDLIBS= -L${LIBSA} -lsa -L${LIBIOCS} -liocs
52 .include "../Makefile.booters"
54 realall: ${PROG}
55 ${PROG}: ${OBJS} ${LIBSA}/libsa.a ${LIBIOCS}/libiocs.a
56 ${_MKTARGET_LINK}
57 ${LD} ${LINKFLAGS} -o ${PROG}.sym ${OBJS} ${LDLIBS}
58 ${STRIP} -F ${BFDNAME} -o ${PROG} ${PROG}.sym
60 CLEANFILES+= ${PROG}.sym
62 .include <bsd.prog.mk>