1 # $NetBSD: Makefile,v 1.8 2011/02/26 20:11:24 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 nif.c 9 SRCS+= fxp.c tlp.c rge.c skg.c dsk.c pciide.c siisata.c printf.c 10 SRCS+= vers.c 11 CLEANFILES+= vers.c ${PROG} ${PROG}.bin ${PROG}.img 12 CFLAGS+= -Wall -Wno-main -ffreestanding -msoft-float -mmultiple 13 CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 14 CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP 15 #CPPFLAGS+= -DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200 16 #CPPFLAGS+= -DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600 17 CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} 18 DBG= -Os 19 20 .include <bsd.own.mk> 21 22 # XXX SHOULD NOT NEED TO DEFINE THESE! 23 LIBCRT0= 24 LIBC= 25 LIBCRTBEGIN= 26 LIBCRTEND= 27 28 STRIPFLAG= 29 BINMODE= 444 30 31 RELOC= 1000000 32 ENTRY= _start 33 34 .if !make(obj) && !make(clean) && !make(cleandir) 35 .BEGIN: 36 @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 37 @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 38 .NOPATH: machine powerpc 39 .endif 40 CLEANFILES+= machine powerpc 41 42 ### find out what to use for libkern 43 KERN_AS= library 44 .include "${S}/lib/libkern/Makefile.inc" 45 LIBKERN= ${KERNLIB} 46 47 ### find out what to use for libz 48 Z_AS= library 49 .include "${S}/lib/libz/Makefile.inc" 50 LIBZ= ${ZLIB} 51 52 ### find out what to use for libsa 53 SA_AS= library 54 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 55 .include "${S}/lib/libsa/Makefile.inc" 56 LIBSA= ${SALIB} 57 58 .PHONY: vers.c 59 vers.c: version 60 ${HOST_SH} ${S}/conf/newvers_stand.sh -K \ 61 ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "sandpoint" 62 63 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 64 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 65 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 66 ${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin 67 ${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \ 68 -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img 69 70 .include <bsd.prog.mk> 71