Makefile.gzboot revision 1.32
1# $NetBSD: Makefile.gzboot,v 1.32 2016/01/31 02:16:28 christos Exp $ 2 3NOMAN= # defined 4 5.include <bsd.obj.mk> # Pull in OBJDIR name rules. 6MKPIE:=no 7MKCTF:=no 8.include <bsd.own.mk> 9.include <bsd.klinks.mk> 10 11EVBARM_STAND= ${S}/arch/evbarm/stand 12 13BASE= gzboot_${PLATFORM}_${RELOC} 14PROGSYM=${BASE}.sym 15PROG= ${BASE}.bin 16WARNS= 1 17 18NEWVERSWHAT= "Gzip Boot" 19VERSIONFILE= ${EVBARM_STAND}/gzboot/version 20 21BINMODE=644 22 23DBG= -Os 24 25# XXX SHOULD NOT NEED TO DEFINE THESE! 26LIBCRT0= 27LIBCRTI= 28LIBC= 29LIBCRTBEGIN= 30LIBCRTEND= 31STRIPFLAG= 32 33.PATH: ${EVBARM_STAND}/gzboot 34.PATH: ${EVBARM_STAND}/board 35 36SRCS+= gzboot.c image.S 37 38STARTFILE= srtbegin.o 39 40CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board 41CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa 42CPPFLAGS+= -I${S}/../common/dist/zlib 43CPPFLAGS+= ${ARM_APCS_FLAGS} 44.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48 45CPPFLAGS+= -marm 46.else 47CPPFLAGS+= -mno-thumb -mno-thumb-interwork 48.endif 49 50CPPFLAGS+= -D_STANDALONE 51 52# Specify the heap size (used by board mem_init() routines) 53CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576 # 1M 54 55# libsa options 56CPPFLAGS+= -DHEAP_VARIABLE 57 58CPPFLAGS+= -DRELOC=${RELOC} 59CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE} 60CPPFLAGS+= -DLOADADDR=${LOADADDR} 61 62COPTS+= -ffreestanding 63COPTS+= -fno-stack-protector 64COPTS+= -fno-unwind-tables 65CWARNFLAGS+= -Werror 66CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 67 68CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list 69CLEANFILES+= ${PROGSYM} 70SRCS+= vers.c 71 72### find out what to use for libkern 73KERN_AS= library 74.include "${S}/lib/libkern/Makefile.inc" 75LIBKERN= ${KERNLIB} 76 77### find out what to use for libz 78Z_AS= library 79.include "${S}/lib/libz/Makefile.inc" 80LIBZ= ${ZLIB} 81 82### find out what to use for libsa 83SA_AS= library 84.include "${S}/lib/libsa/Makefile.inc" 85LIBSA= ${SALIB} 86 87cleandir distclean: .WAIT cleanlibdir 88 89cleanlibdir: 90 -rm -rf lib 91 92LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx 93 94LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA} 95 96.PHONY: vers.c 97vers.c: ${VERSIONFILE} 98 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 99 ${.ALLSRC} '${PLATFORM}' ${NEWVERSWHAT} 100 101${PROG}: ${PROGSYM} 102 ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET} 103 104# Prevent the normal install target from doing anything. 105proginstall:: 106 107# Install the raw binary or the symbol version, based on whether or 108# not the resulting gzboot needs to be mdsetimage'd. 109.if ${MAXIMAGESIZE} == "0" 110FILES= ${PROG} 111.else 112FILES= ${PROGSYM} 113.endif 114 115.include <bsd.prog.mk> 116 117${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 118 ${_MKTARGET_LINK} 119 ${LD} -o ${.TARGET} ${LDFLAGS} ${STARTFILE} \ 120 ${OBJS} ${LIBLIST} > ${BASE}.list 121