1 # $NetBSD: Makefile,v 1.15 2013/12/15 18:08:37 joerg 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+= ${ARM_APCS_FLAGS} -mcpu=xscale 25 .if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48 26 CPPFLAGS+= -marm 27 .else 28 CPPFLAGS+= -mno-thumb -mno-thumb-interwork 29 .endif 30 CPUFLAGS= 31 AFLAGS+= -D_LOCORE 32 LDFLAGS+= -nostdlib -Bstatic 33 34 CLEANFILES+= vers.c vers.o 35 36 LIBCRT0= crt0.o 37 LIBC= # nothing 38 LIBCRTBEGIN= # nothing 39 LIBCRTEND= # nothing 40 41 NEWVERSWHAT?= "Boot" 42 VERSIONFILE?= ${.CURDIR}/version 43 44 ### find out what to use for libkern 45 KERN_AS= library 46 .include "${S}/lib/libkern/Makefile.inc" 47 LIBKERN= ${KERNLIB} 48 49 ### find out what to use for libz 50 Z_AS= library 51 .include "${S}/lib/libz/Makefile.inc" 52 LIBZ= ${ZLIB} 53 54 ### find out what to use for libsa 55 SA_AS= library 56 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_ENABLE_LS_OP=yes 57 .include "${S}/lib/libsa/Makefile.inc" 58 LIBSA= ${SALIB} 59 60 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} 61 ${_MKTARGET_LINK} 62 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 63 ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} 64 ${CC} ${CFLAGS} ${CPPFLAGS} -c vers.c 65 ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} 66 67 .include <bsd.klinks.mk> 68 .include <bsd.prog.mk> 69 70 cleandir distclean: .WAIT cleanlibdir 71 72 cleanlibdir: 73 -rm -rf lib 74 75 release: check_RELEASEDIR 76 ${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \ 77 ${RELEASEDIR}/${MACHINE}/installation 78