No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / evbarm / stand / gzboot / Makefile.gzboot
blob1919db09312e41e61379eb9dc58e20c0acb2f1d9
1 #       $NetBSD: Makefile.gzboot,v 1.14 2006/01/16 19:34:53 he Exp $
3 NOMAN=  # defined
5 .include <bsd.obj.mk>           # Pull in OBJDIR name rules.
6 .include <bsd.own.mk>
8 EVBARM_STAND=   ${S}/arch/evbarm/stand
10 BASE=   gzboot_${PLATFORM}_${RELOC}
11 PROGSYM=${BASE}.sym
12 PROG=   ${BASE}.bin
13 WARNS=  1
15 NEWVERSWHAT=    "Gzip Boot"
16 VERSIONFILE=    ${EVBARM_STAND}/gzboot/version
18 BINMODE=644
20 DBG=    -Os
22 # XXX SHOULD NOT NEED TO DEFINE THESE!
23 LIBCRT0=
24 LIBC=
25 LIBCRTBEGIN= 
26 LIBCRTEND=      
28 .PATH: ${EVBARM_STAND}/gzboot
29 .PATH: ${EVBARM_STAND}/board
31 SRCS+=  gzboot.c image.S
33 STARTFILE= srtbegin.o
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
44 # libsa options
45 CPPFLAGS+= -DHEAP_VARIABLE
47 CPPFLAGS+= -DRELOC=${RELOC}
48 CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
49 CPPFLAGS+= -DLOADADDR=${LOADADDR}
51 COPTS+= -ffreestanding
52 CWARNFLAGS+= -Werror
53 CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
55 CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
56 CLEANFILES+= ${PROGSYM}
57 SRCS+= vers.c
59 .if !make(obj) && !make(clean) && !make(cleandir)
60 .NOPATH: machine
61 .endif
63 realdepend realall: machine
64 CLEANFILES+= arm machine
66 machine::
67         -rm -f arm machine
68         ln -s ${S}/arch/evbarm/include machine
69         ln -s ${S}/arch/arm/include arm
71 ${OBJS}: machine
73 ### find out what to use for libkern
74 KERN_AS=        library
75 .include "${S}/lib/libkern/Makefile.inc"
76 LIBKERN=        ${KERNLIB}
78 ### find out what to use for libz
79 Z_AS=           library
80 .include "${S}/lib/libz/Makefile.inc"
81 LIBZ=           ${ZLIB}
83 ### find out what to use for libsa
84 SA_AS=          library
85 .include "${S}/lib/libsa/Makefile.inc"
86 LIBSA=          ${SALIB}
88 cleandir distclean: cleanlibdir
90 cleanlibdir:
91         -rm -rf lib
93 LDFLAGS= -M -T ${LDSCRIPT}
95 LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
97 .PHONY: vers.c
98 vers.c: ${VERSIONFILE}
99         ${HOST_SH} ${S}/conf/newvers_stand.sh ${.ALLSRC} '${PLATFORM}' \
100             ${NEWVERSWHAT}
102 ${PROG}: ${PROGSYM}
103         ${OBJCOPY} -O binary ${PROGSYM} ${.TARGET}
105 # Prevent the normal install target from doing anything.
106 proginstall::
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"
111 FILES=  ${PROG}
112 .else
113 FILES=  ${PROGSYM}
114 .endif
116 .include <bsd.prog.mk>
118 ${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
119         ${LD} -o ${.TARGET} ${LDFLAGS} ${STARTFILE} \
120             ${OBJS} ${LIBLIST} > ${BASE}.list