1 # $NetBSD: Makefile,v 1.14.2.1 2014/08/10 06:54:07 tls Exp $ 2 3 S= ${.CURDIR}/../../../.. 4 5 PROG= altboot 6 FILES+= ${PROG}.bin ${PROG}.img 7 NOMAN= # defined 8 SRCS= entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c 9 SRCS+= nif.c fxp.c tlp.c rge.c skg.c stg.c 10 SRCS+= dsk.c pciide.c siisata.c 11 SRCS+= exception.c vers.c 12 CLEANFILES+= vers.c ${PROG} ${PROG}.bin ${PROG}.img 13 CFLAGS+= -Wall -Wno-main -ffreestanding -msoft-float 14 CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 15 CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT 16 #CPPFLAGS+= -DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200 17 #CPPFLAGS+= -DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600 18 CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} 19 DBG= -Os 20 21 .include <bsd.own.mk> 22 .include <bsd.klinks.mk> 23 24 # XXX SHOULD NOT NEED TO DEFINE THESE! 25 LIBCRT0= 26 LIBCRTI= 27 LIBC= 28 LIBCRTBEGIN= 29 LIBCRTEND= 30 31 STRIPFLAG= 32 BINMODE= 444 33 34 RELOC= 1000000 35 ENTRY= _start 36 37 ### find out what to use for libkern 38 KERN_AS= library 39 .include "${S}/lib/libkern/Makefile.inc" 40 LIBKERN= ${KERNLIB} 41 42 ### find out what to use for libz 43 Z_AS= library 44 .include "${S}/lib/libz/Makefile.inc" 45 LIBZ= ${ZLIB} 46 47 ### find out what to use for libsa 48 SA_AS= library 49 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 50 .include "${S}/lib/libsa/Makefile.inc" 51 LIBSA= ${SALIB} 52 53 .PHONY: vers.c 54 vers.c: version 55 ${HOST_SH} ${S}/conf/newvers_stand.sh -K \ 56 ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "sandpoint" 57 58 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 59 ${_MKTARGET_LINK} 60 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 61 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 62 ${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin 63 ${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \ 64 -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img 65 66 .include <bsd.prog.mk> 67