Makefile.gzboot revision 1.36
1# $NetBSD: Makefile.gzboot,v 1.36 2017/04/08 19:53:20 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} 40CPPFLAGS+= -marm 41 42CPPFLAGS+= -D_STANDALONE 43 44# Specify the heap size (used by board mem_init() routines) 45CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576 # 1M 46 47# libsa options 48CPPFLAGS+= -DHEAP_VARIABLE 49 50CPPFLAGS+= -DRELOC=${RELOC} 51CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE} 52CPPFLAGS+= -DLOADADDR=${LOADADDR} 53 54COPTS+= -ffreestanding 55COPTS+= -fno-stack-protector 56COPTS+= -fno-unwind-tables 57CWARNFLAGS+= -Werror 58CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 59 60CLEANFILES+= ${STARTFILE} ${BASE}.list 61CLEANFILES+= ${PROGSYM} 62 63### find out what to use for libkern 64KERN_AS= library 65.include "${S}/lib/libkern/Makefile.inc" 66LIBKERN= ${KERNLIB} 67 68### find out what to use for libz 69Z_AS= library 70.include "${S}/lib/libz/Makefile.inc" 71LIBZ= ${ZLIB} 72 73### find out what to use for libsa 74SA_AS= library 75.include "${S}/lib/libsa/Makefile.inc" 76LIBSA= ${SALIB} 77 78cleandir distclean: .WAIT cleanlibdir 79 80cleanlibdir: 81 -rm -rf lib 82 83DIRECT_LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx 84 85LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA} 86 87.include "${S}/conf/newvers_stand.mk" 88 89${PROG}: ${PROGSYM} 90 ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET} 91 92# Prevent the normal install target from doing anything. 93proginstall:: 94 95# Install the raw binary or the symbol version, based on whether or 96# not the resulting gzboot needs to be mdsetimage'd. 97.if ${MAXIMAGESIZE} == "0" 98FILES= ${PROG} 99.else 100FILES= ${PROGSYM} 101.endif 102 103.include <bsd.prog.mk> 104 105${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 106 ${_MKTARGET_LINK} 107 ${LD} -o ${.TARGET} ${DIRECT_LDFLAGS} ${STARTFILE} \ 108 ${OBJS} ${LIBLIST} > ${BASE}.list 109