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