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