1 1.7 thorpej # $NetBSD: Makefile.gzboot,v 1.7 2003/04/29 05:15:14 thorpej Exp $ 2 1.1 thorpej 3 1.1 thorpej NOMAN= # defined 4 1.1 thorpej 5 1.1 thorpej .include <bsd.own.mk> 6 1.1 thorpej 7 1.1 thorpej EVBARM_STAND= ${S}/arch/evbarm/stand 8 1.1 thorpej 9 1.1 thorpej BASE= gzboot_${PLATFORM}_${RELOC} 10 1.7 thorpej PROGSYM=${BASE}.sym 11 1.7 thorpej PROG= ${BASE}.bin 12 1.1 thorpej WARNS= 1 13 1.1 thorpej 14 1.1 thorpej NEWVERSWHAT= "Gzip Boot" 15 1.1 thorpej VERSIONFILE= ${EVBARM_STAND}/gzboot/version 16 1.1 thorpej 17 1.1 thorpej BINMODE=644 18 1.1 thorpej 19 1.1 thorpej DBG= -Os 20 1.1 thorpej 21 1.1 thorpej # XXX SHOULD NOT NEED TO DEFINE THESE! 22 1.1 thorpej LIBCRT0= 23 1.1 thorpej LIBC= 24 1.1 thorpej LIBCRTBEGIN= 25 1.1 thorpej LIBCRTEND= 26 1.1 thorpej 27 1.1 thorpej .PATH: ${EVBARM_STAND}/gzboot 28 1.1 thorpej .PATH: ${EVBARM_STAND}/board 29 1.1 thorpej 30 1.4 thorpej SRCS+= gzboot.c image.S 31 1.1 thorpej 32 1.1 thorpej STARTFILE= srtbegin.o 33 1.1 thorpej 34 1.1 thorpej CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board 35 1.1 thorpej CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa 36 1.3 thorpej 37 1.1 thorpej CPPFLAGS+= -D_STANDALONE 38 1.5 thorpej 39 1.5 thorpej # Specify the heap size (used by board mem_init() routines) 40 1.5 thorpej CPPFLAGS+= -DHEAP_SIZE=1048576 # 1M 41 1.3 thorpej 42 1.3 thorpej # libsa options 43 1.1 thorpej CPPFLAGS+= -DHEAP_VARIABLE 44 1.3 thorpej 45 1.3 thorpej CPPFLAGS+= -DRELOC=${RELOC} 46 1.3 thorpej CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE} 47 1.3 thorpej CPPFLAGS+= -DLOADADDR=${LOADADDR} 48 1.1 thorpej 49 1.1 thorpej COPTS+= -ffreestanding 50 1.1 thorpej CWARNFLAGS+= -Wno-main 51 1.1 thorpej 52 1.1 thorpej CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list 53 1.1 thorpej SRCS+= vers.c 54 1.1 thorpej 55 1.1 thorpej .if !make(obj) && !make(clean) && !make(cleandir) 56 1.1 thorpej .BEGIN: machine 57 1.1 thorpej .NOPATH: machine 58 1.1 thorpej .endif 59 1.1 thorpej 60 1.1 thorpej realdepend realall: machine 61 1.1 thorpej CLEANFILES+= arm machine 62 1.1 thorpej 63 1.1 thorpej machine:: 64 1.1 thorpej -rm -f arm machine 65 1.1 thorpej ln -s ${S}/arch/evbarm/include machine 66 1.1 thorpej ln -s ${S}/arch/arm/include arm 67 1.1 thorpej 68 1.1 thorpej ${OBJS}: machine 69 1.1 thorpej 70 1.1 thorpej ### find out what to use for libkern 71 1.1 thorpej KERN_AS= library 72 1.1 thorpej .include "${S}/lib/libkern/Makefile.inc" 73 1.1 thorpej LIBKERN= ${KERNLIB} 74 1.1 thorpej 75 1.1 thorpej ### find out what to use for libz 76 1.1 thorpej Z_AS= library 77 1.1 thorpej .include "${S}/lib/libz/Makefile.inc" 78 1.1 thorpej LIBZ= ${ZLIB} 79 1.1 thorpej 80 1.1 thorpej ### find out what to use for libsa 81 1.1 thorpej SA_AS= library 82 1.1 thorpej .include "${S}/lib/libsa/Makefile.inc" 83 1.1 thorpej LIBSA= ${SALIB} 84 1.1 thorpej 85 1.1 thorpej cleandir distclean: cleanlibdir 86 1.1 thorpej 87 1.1 thorpej cleanlibdir: 88 1.1 thorpej rm -rf lib 89 1.1 thorpej 90 1.4 thorpej LDFLAGS= -M -T ${LDSCRIPT} 91 1.1 thorpej 92 1.1 thorpej LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA} 93 1.1 thorpej 94 1.1 thorpej .PHONY: vers.c 95 1.1 thorpej vers.c: ${VERSIONFILE} 96 1.1 thorpej sh ${S}/conf/newvers_stand.sh ${.ALLSRC} '${PLATFORM}' \ 97 1.1 thorpej ${NEWVERSWHAT} 98 1.1 thorpej 99 1.7 thorpej ${PROG}: ${PROGSYM} 100 1.7 thorpej ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET} 101 1.1 thorpej 102 1.1 thorpej .include <bsd.prog.mk> 103 1.7 thorpej 104 1.7 thorpej ${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 105 1.7 thorpej ${LD} -o ${.TARGET} ${LDFLAGS} ${STARTFILE} \ 106 1.7 thorpej ${OBJS} ${LIBLIST} > ${BASE}.list 107