Makefile.gzboot revision 1.37
1# $NetBSD: Makefile.gzboot,v 1.37 2019/10/24 18:46:21 christos 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 53COPTS+= -ffreestanding 54COPTS+= -fno-stack-protector 55COPTS+= -fno-unwind-tables 56CWARNFLAGS+= -Werror 57CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 58 59CLEANFILES+= ${STARTFILE} ${BASE}.list 60CLEANFILES+= ${PROGSYM} 61 62### find out what to use for libkern 63KERN_AS= library 64.include "${S}/lib/libkern/Makefile.inc" 65LIBKERN= ${KERNLIB} 66 67### find out what to use for libz 68Z_AS= library 69.include "${S}/lib/libz/Makefile.inc" 70LIBZ= ${ZLIB} 71 72### find out what to use for libsa 73SA_AS= library 74.include "${S}/lib/libsa/Makefile.inc" 75LIBSA= ${SALIB} 76 77cleandir distclean: .WAIT cleanlibdir 78 79cleanlibdir: 80 -rm -rf lib 81 82DIRECT_LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx 83 84LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA} 85 86.include "${S}/conf/newvers_stand.mk" 87 88${PROG}: ${PROGSYM} 89 ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET} 90 91# Prevent the normal install target from doing anything. 92proginstall:: 93 94# Install the raw binary or the symbol version, based on whether or 95# not the resulting gzboot needs to be mdsetimage'd. 96.if ${MAXIMAGESIZE} == "0" 97FILES= ${PROG} 98.else 99FILES= ${PROGSYM} 100.endif 101 102.include <bsd.prog.mk> 103 104${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 105 ${_MKTARGET_LINK} 106 ${LD} -o ${.TARGET} ${DIRECT_LDFLAGS} ${STARTFILE} \ 107 ${OBJS} ${LIBLIST} > ${BASE}.list 108