Makefile.gzboot revision 1.35
1# $NetBSD: Makefile.gzboot,v 1.35 2017/02/22 12:51:38 maya Exp $ 2 3NOMAN= # defined 4 5.include <bsd.init.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= 29STRIPFLAG= 30 31.PATH: ${EVBARM_STAND}/gzboot 32.PATH: ${EVBARM_STAND}/board 33 34SRCS+= gzboot.c image.S 35 36STARTFILE= srtbegin.o 37 38CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board 39CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa 40CPPFLAGS+= -I${S}/../common/dist/zlib 41CPPFLAGS+= ${ARM_APCS_FLAGS} 42CPPFLAGS+= -marm 43 44CPPFLAGS+= -D_STANDALONE 45 46# Specify the heap size (used by board mem_init() routines) 47CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576 # 1M 48 49# libsa options 50CPPFLAGS+= -DHEAP_VARIABLE 51 52CPPFLAGS+= -DRELOC=${RELOC} 53CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE} 54CPPFLAGS+= -DLOADADDR=${LOADADDR} 55 56COPTS+= -ffreestanding 57COPTS+= -fno-stack-protector 58COPTS+= -fno-unwind-tables 59CWARNFLAGS+= -Werror 60CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 61 62CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list 63CLEANFILES+= ${PROGSYM} 64SRCS+= vers.c 65 66### find out what to use for libkern 67KERN_AS= library 68.include "${S}/lib/libkern/Makefile.inc" 69LIBKERN= ${KERNLIB} 70 71### find out what to use for libz 72Z_AS= library 73.include "${S}/lib/libz/Makefile.inc" 74LIBZ= ${ZLIB} 75 76### find out what to use for libsa 77SA_AS= library 78.include "${S}/lib/libsa/Makefile.inc" 79LIBSA= ${SALIB} 80 81cleandir distclean: .WAIT cleanlibdir 82 83cleanlibdir: 84 -rm -rf lib 85 86DIRECT_LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx 87 88LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA} 89 90.PHONY: vers.c 91vers.c: ${VERSIONFILE} 92 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 93 ${.ALLSRC} '${PLATFORM}' ${NEWVERSWHAT} 94 95${PROG}: ${PROGSYM} 96 ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET} 97 98# Prevent the normal install target from doing anything. 99proginstall:: 100 101# Install the raw binary or the symbol version, based on whether or 102# not the resulting gzboot needs to be mdsetimage'd. 103.if ${MAXIMAGESIZE} == "0" 104FILES= ${PROG} 105.else 106FILES= ${PROGSYM} 107.endif 108 109.include <bsd.prog.mk> 110 111${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 112 ${_MKTARGET_LINK} 113 ${LD} -o ${.TARGET} ${DIRECT_LDFLAGS} ${STARTFILE} \ 114 ${OBJS} ${LIBLIST} > ${BASE}.list 115