1 # $NetBSD: Makefile,v 1.12 2011/10/30 20:42:09 phx 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 -mmultiple 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 23 # XXX SHOULD NOT NEED TO DEFINE THESE! 24 LIBCRT0= 25 LIBC= 26 LIBCRTBEGIN= 27 LIBCRTEND= 28 29 STRIPFLAG= 30 BINMODE= 444 31 32 RELOC= 1000000 33 ENTRY= _start 34 35 .if !make(obj) && !make(clean) && !make(cleandir) 36 .BEGIN: 37 @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 38 @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 39 .NOPATH: machine powerpc 40 .endif 41 CLEANFILES+= machine powerpc 42 43 ### find out what to use for libkern 44 KERN_AS= library 45 .include "${S}/lib/libkern/Makefile.inc" 46 LIBKERN= ${KERNLIB} 47 48 ### find out what to use for libz 49 Z_AS= library 50 .include "${S}/lib/libz/Makefile.inc" 51 LIBZ= ${ZLIB} 52 53 ### find out what to use for libsa 54 SA_AS= library 55 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 56 .include "${S}/lib/libsa/Makefile.inc" 57 LIBSA= ${SALIB} 58 59 .PHONY: vers.c 60 vers.c: version 61 ${HOST_SH} ${S}/conf/newvers_stand.sh -K \ 62 ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "sandpoint" 63 64 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 65 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 66 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 67 ${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin 68 ${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \ 69 -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img 70 71 .include <bsd.prog.mk> 72