1 # $NetBSD: Makefile,v 1.16 2014/01/12 15:26:31 tsutsui 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 LIBCRTI= # nothing 38 LIBC= # nothing 39 LIBCRTBEGIN= # nothing 40 LIBCRTEND= # nothing 41 42 NEWVERSWHAT?= "Boot" 43 VERSIONFILE?= ${.CURDIR}/version 44 45 ### find out what to use for libkern 46 KERN_AS= library 47 .include "${S}/lib/libkern/Makefile.inc" 48 LIBKERN= ${KERNLIB} 49 50 ### find out what to use for libz 51 Z_AS= library 52 .include "${S}/lib/libz/Makefile.inc" 53 LIBZ= ${ZLIB} 54 55 ### find out what to use for libsa 56 SA_AS= library 57 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_ENABLE_LS_OP=yes 58 .include "${S}/lib/libsa/Makefile.inc" 59 LIBSA= ${SALIB} 60 61 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} 62 ${_MKTARGET_LINK} 63 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 64 ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} 65 ${CC} ${CFLAGS} ${CPPFLAGS} -c vers.c 66 ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} 67 68 .include <bsd.klinks.mk> 69 .include <bsd.prog.mk> 70 71 cleandir distclean: .WAIT cleanlibdir 72 73 cleanlibdir: 74 -rm -rf lib 75 76 release: check_RELEASEDIR 77 ${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \ 78 ${RELEASEDIR}/${MACHINE}/installation 79