1 # $NetBSD: Makefile.gzboot,v 1.14 2006/01/16 19:34:53 he Exp $
5 .include <bsd.obj.mk> # Pull in OBJDIR name rules.
8 EVBARM_STAND= ${S}/arch/evbarm/stand
10 BASE= gzboot_${PLATFORM}_${RELOC}
15 NEWVERSWHAT= "Gzip Boot"
16 VERSIONFILE= ${EVBARM_STAND}/gzboot/version
22 # XXX SHOULD NOT NEED TO DEFINE THESE!
28 .PATH: ${EVBARM_STAND}/gzboot
29 .PATH: ${EVBARM_STAND}/board
31 SRCS+= gzboot.c image.S
35 CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board
36 CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa
37 CPPFLAGS+= -I${S}/../common/dist/zlib
39 CPPFLAGS+= -D_STANDALONE
41 # Specify the heap size (used by board mem_init() routines)
42 CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576 # 1M
45 CPPFLAGS+= -DHEAP_VARIABLE
47 CPPFLAGS+= -DRELOC=${RELOC}
48 CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
49 CPPFLAGS+= -DLOADADDR=${LOADADDR}
51 COPTS+= -ffreestanding
53 CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
55 CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
56 CLEANFILES+= ${PROGSYM}
59 .if !make(obj) && !make(clean) && !make(cleandir)
63 realdepend realall: machine
64 CLEANFILES+= arm machine
68 ln -s ${S}/arch/evbarm/include machine
69 ln -s ${S}/arch/arm/include arm
73 ### find out what to use for libkern
75 .include "${S}/lib/libkern/Makefile.inc"
78 ### find out what to use for libz
80 .include "${S}/lib/libz/Makefile.inc"
83 ### find out what to use for libsa
85 .include "${S}/lib/libsa/Makefile.inc"
88 cleandir distclean: cleanlibdir
93 LDFLAGS= -M -T ${LDSCRIPT}
95 LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
98 vers.c: ${VERSIONFILE}
99 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.ALLSRC} '${PLATFORM}' \
103 ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET}
105 # Prevent the normal install target from doing anything.
108 # Install the raw binary or the symbol version, based on whether or
109 # not the resulting gzboot needs to be mdsetimage'd.
110 .if ${MAXIMAGESIZE} == "0"
116 .include <bsd.prog.mk>
118 ${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
119 ${LD} -o ${.TARGET} ${LDFLAGS} ${STARTFILE} \
120 ${OBJS} ${LIBLIST} > ${BASE}.list