1 # $NetBSD: Makefile,v 1.11 2013/08/12 22:50:51 matt Exp $ 2 3 PROG= zboot 4 5 S= ${.CURDIR}/../../../.. 6 7 SRCS= crt0.c 8 SRCS+= boot.c bootinfo.c bootmenu.c conf.c devopen.c diskprobe.c 9 SRCS+= loadfile_zboot.c 10 SRCS+= getsecs.c termios.c unixcons.c unixdev.c unixsys.S 11 SRCS+= pathfs.c 12 13 NOMAN= # defined 14 15 .include <bsd.own.mk> 16 17 CFLAGS+= -Wall -Wno-main 18 CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 19 CFLAGS+= -fno-stack-protector -fno-builtin -ffreestanding 20 CFLAGS+= -fno-unwind-tables 21 CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} 22 CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE 23 CPPFLAGS+= -DLIBSA_ENABLE_LS_OP 24 CPPFLAGS+= -mabi=apcs-gnu -mfloat-abi=soft -mcpu=xscale 25 CPUFLAGS= 26 AFLAGS+= -D_LOCORE 27 LDFLAGS+= -nostdlib -Bstatic 28 29 CLEANFILES+= vers.c vers.o 30 31 LIBCRT0= crt0.o 32 LIBC= # nothing 33 LIBCRTBEGIN= # nothing 34 LIBCRTEND= # nothing 35 36 NEWVERSWHAT?= "Boot" 37 VERSIONFILE?= ${.CURDIR}/version 38 39 ### find out what to use for libkern 40 KERN_AS= library 41 .include "${S}/lib/libkern/Makefile.inc" 42 LIBKERN= ${KERNLIB} 43 44 ### find out what to use for libz 45 Z_AS= library 46 .include "${S}/lib/libz/Makefile.inc" 47 LIBZ= ${ZLIB} 48 49 ### find out what to use for libsa 50 SA_AS= library 51 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_ENABLE_LS_OP=yes 52 .include "${S}/lib/libsa/Makefile.inc" 53 LIBSA= ${SALIB} 54 55 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} 56 ${_MKTARGET_LINK} 57 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 58 ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} 59 ${CC} ${CFLAGS} ${CPPFLAGS} -c vers.c 60 ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} 61 62 .include <bsd.klinks.mk> 63 .include <bsd.prog.mk> 64 65 cleandir distclean: .WAIT cleanlibdir 66 67 cleanlibdir: 68 -rm -rf lib 69 70 release: check_RELEASEDIR 71 ${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \ 72 ${RELEASEDIR}/${MACHINE}/installation 73