Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / sgimips / stand / boot64 / Makefile
blobd7a4b4543bf8d904a96a7c61500f262b77b5a9d6
1 # $NetBSD: Makefile,v 1.5 2008/02/23 06:51:28 tsutsui Exp $
3 PROG= ip30boot
5 SRCS= start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
6 getopt.c disk.c
8 CLEANFILES+= boot.map
10 .include <bsd.sys.mk> # for HOST_SH
12 # $S must correspond to the top of the 'sys' tree
13 S= ${.CURDIR}/../../../..
15 BINMODE?= 444
17 realall: ${PROG}
19 .PATH: ${.CURDIR}/../common
20 AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls -mabi=64 -D_LP64
21 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
22 # compiler flags for smallest code size
23 CFLAGS= -ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024 -mabi=64 -D_LP64
24 LDBUG= -T $S/arch/mips/conf/stand.ldscript
25 NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
26 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
28 CPPFLAGS+= -Dsgimips
30 # PROG set by parent.
31 NOMAN= # defined
33 # We load the kernel at 420K in from the start of RAM to give the boot
34 # loader plenty of breathing room. Load the boot loader starting at
35 # the second page of RAM.
37 LOAD_ADDRESS_IP30?= 0xa800000020080000
39 # if there is a 'version' file, add rule for vers.c and add it to SRCS
40 # and CLEANFILES
41 .if exists(version)
42 .PHONY: vers.c
43 vers.c: ${.CURDIR}/version
44 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "sgimips"
46 SRCS+= vers.c
47 CLEANFILES+= vers.c
48 .endif
50 ### find out what to use for libkern
51 KERN_AS= library
52 KERNMISCMAKEFLAGS+= LD="${LD} -m elf64btsmip" RANLIB="true"
53 .include "${S}/lib/libkern/Makefile.inc"
54 LIBKERN= ${KERNLIB}
56 ### find out what to use for libz
57 Z_AS= library
58 ZMISCMAKEFLAGS+= LD="${LD} -m elf64btsmip" RANLIB="true"
59 .include "${S}/lib/libz/Makefile.inc"
60 LIBZ= ${ZLIB}
62 ### find out what to use for libsa
63 SA_AS= library
64 SAMISCMAKEFLAGS+= SA_USE_LOADFILE=yes SA_USE_CREAD=yes \
65 LD="${LD} -m elf64btsmip" RANLIB="true"
66 .include "${S}/lib/libsa/Makefile.inc"
67 LIBSA= ${SALIB}
70 LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
72 ip30boot: ${OBJS} ${LIBS}
73 ${LD} -m elf64btsmip -Map boot.map -x -Ttext ${LOAD_ADDRESS_IP30} \
74 ${LDBUG} -e start -o ${.TARGET} ${OBJS} ${LIBS}
76 cleandir distclean: cleanlibdir
77 cleanlibdir:
78 -rm -rf lib
80 .include <bsd.klinks.mk>
81 .include <bsd.prog.mk>