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