1# $NetBSD: Makefile,v 1.17 2017/04/08 19:53:22 christos 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 12CLEANFILES+= ${PROG} ${PROG}.bin ${PROG}.img 13CFLAGS+= -Wall -Wno-main -ffreestanding 14CFLAGS+= ${${ACTIVE_CC} == "gcc":? -msoft-float :} 15CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 16CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT 17#CPPFLAGS+= -DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200 18#CPPFLAGS+= -DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600 19CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} 20DBG= -Os 21 22.include <bsd.own.mk> 23.include <bsd.klinks.mk> 24 25# XXX SHOULD NOT NEED TO DEFINE THESE! 26LIBCRT0= 27LIBCRTI= 28LIBC= 29LIBCRTBEGIN= 30LIBCRTEND= 31 32STRIPFLAG= 33BINMODE= 444 34 35RELOC= 1000000 36ENTRY= _start 37 38### find out what to use for libkern 39KERN_AS= library 40.include "${S}/lib/libkern/Makefile.inc" 41LIBKERN= ${KERNLIB} 42 43### find out what to use for libz 44Z_AS= library 45.include "${S}/lib/libz/Makefile.inc" 46LIBZ= ${ZLIB} 47 48### find out what to use for libsa 49SA_AS= library 50SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 51.include "${S}/lib/libsa/Makefile.inc" 52LIBSA= ${SALIB} 53 54${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 55 ${_MKTARGET_LINK} 56 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 57 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 58 ${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin 59 ${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \ 60 -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img 61 62VERSIONFLAGS+=-k 63.include "${S}/conf/newvers_stand.mk" 64 65.include <bsd.prog.mk> 66