Home | History | Annotate | Line # | Download | only in gzboot
Makefile.gzboot revision 1.20
      1  1.20   khorben #	$NetBSD: Makefile.gzboot,v 1.20 2012/08/13 10:25:02 khorben Exp $
      2   1.1   thorpej 
      3   1.1   thorpej NOMAN=  # defined
      4   1.1   thorpej 
      5  1.11       bsh .include <bsd.obj.mk>		# Pull in OBJDIR name rules.
      6   1.1   thorpej .include <bsd.own.mk>
      7   1.1   thorpej 
      8   1.1   thorpej EVBARM_STAND=	${S}/arch/evbarm/stand
      9   1.1   thorpej 
     10   1.1   thorpej BASE=	gzboot_${PLATFORM}_${RELOC}
     11   1.7   thorpej PROGSYM=${BASE}.sym
     12   1.7   thorpej PROG=	${BASE}.bin
     13   1.1   thorpej WARNS=	1
     14   1.1   thorpej 
     15   1.1   thorpej NEWVERSWHAT=	"Gzip Boot"
     16   1.1   thorpej VERSIONFILE=	${EVBARM_STAND}/gzboot/version
     17   1.1   thorpej 
     18   1.1   thorpej BINMODE=644
     19   1.1   thorpej 
     20   1.1   thorpej DBG=	-Os
     21   1.1   thorpej 
     22   1.1   thorpej # XXX SHOULD NOT NEED TO DEFINE THESE!
     23   1.1   thorpej LIBCRT0=
     24   1.1   thorpej LIBC=
     25   1.1   thorpej LIBCRTBEGIN= 
     26   1.1   thorpej LIBCRTEND=      
     27   1.1   thorpej 
     28   1.1   thorpej .PATH: ${EVBARM_STAND}/gzboot
     29   1.1   thorpej .PATH: ${EVBARM_STAND}/board
     30   1.1   thorpej 
     31   1.4   thorpej SRCS+=	gzboot.c image.S
     32   1.1   thorpej 
     33   1.1   thorpej STARTFILE= srtbegin.o
     34   1.1   thorpej 
     35   1.1   thorpej CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board
     36   1.1   thorpej CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa
     37  1.15   tsutsui CPPFLAGS+= -I${S}/../common/dist/zlib
     38   1.3   thorpej 
     39   1.1   thorpej CPPFLAGS+= -D_STANDALONE
     40   1.5   thorpej 
     41   1.5   thorpej # Specify the heap size (used by board mem_init() routines)
     42  1.14        he CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576		# 1M
     43   1.3   thorpej 
     44   1.3   thorpej # libsa options
     45   1.1   thorpej CPPFLAGS+= -DHEAP_VARIABLE
     46   1.3   thorpej 
     47   1.3   thorpej CPPFLAGS+= -DRELOC=${RELOC}
     48   1.3   thorpej CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
     49   1.3   thorpej CPPFLAGS+= -DLOADADDR=${LOADADDR}
     50   1.1   thorpej 
     51   1.1   thorpej COPTS+=	-ffreestanding
     52  1.20   khorben COPTS+=	-fno-stack-protector
     53  1.15   tsutsui CWARNFLAGS+= -Werror
     54  1.15   tsutsui CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     55   1.1   thorpej 
     56   1.1   thorpej CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
     57   1.8   thorpej CLEANFILES+= ${PROGSYM}
     58   1.1   thorpej SRCS+= vers.c
     59   1.1   thorpej 
     60   1.1   thorpej .if !make(obj) && !make(clean) && !make(cleandir)
     61   1.1   thorpej .NOPATH: machine
     62   1.1   thorpej .endif
     63   1.1   thorpej 
     64   1.1   thorpej realdepend realall: machine
     65   1.1   thorpej CLEANFILES+= arm machine
     66   1.1   thorpej 
     67   1.1   thorpej machine::
     68   1.1   thorpej 	-rm -f arm machine
     69   1.1   thorpej 	ln -s ${S}/arch/evbarm/include machine
     70   1.1   thorpej 	ln -s ${S}/arch/arm/include arm
     71   1.1   thorpej 
     72   1.1   thorpej ${OBJS}: machine
     73   1.1   thorpej 
     74   1.1   thorpej ### find out what to use for libkern
     75   1.1   thorpej KERN_AS=	library
     76   1.1   thorpej .include "${S}/lib/libkern/Makefile.inc"
     77   1.1   thorpej LIBKERN=	${KERNLIB}
     78   1.1   thorpej 
     79   1.1   thorpej ### find out what to use for libz
     80   1.1   thorpej Z_AS=		library
     81   1.1   thorpej .include "${S}/lib/libz/Makefile.inc"
     82   1.1   thorpej LIBZ=		${ZLIB}
     83   1.1   thorpej 
     84   1.1   thorpej ### find out what to use for libsa
     85   1.1   thorpej SA_AS=		library
     86   1.1   thorpej .include "${S}/lib/libsa/Makefile.inc"
     87   1.1   thorpej LIBSA=		${SALIB}
     88   1.1   thorpej 
     89  1.16  dholland cleandir distclean: .WAIT cleanlibdir
     90   1.1   thorpej 
     91   1.1   thorpej cleanlibdir:
     92  1.10       jmc 	-rm -rf lib
     93   1.1   thorpej 
     94  1.19      matt LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx
     95   1.1   thorpej 
     96   1.1   thorpej LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
     97   1.1   thorpej 
     98   1.1   thorpej .PHONY: vers.c
     99   1.1   thorpej vers.c: ${VERSIONFILE}
    100  1.17     joerg 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
    101  1.17     joerg 	    ${.ALLSRC} '${PLATFORM}' ${NEWVERSWHAT}
    102   1.1   thorpej 
    103   1.7   thorpej ${PROG}: ${PROGSYM}
    104   1.7   thorpej 	${OBJCOPY} -O binary ${PROGSYM} ${.TARGET}
    105   1.8   thorpej 
    106   1.8   thorpej # Prevent the normal install target from doing anything.
    107   1.8   thorpej proginstall::
    108   1.8   thorpej 
    109   1.8   thorpej # Install the raw binary or the symbol version, based on whether or
    110   1.8   thorpej # not the resulting gzboot needs to be mdsetimage'd.
    111   1.8   thorpej .if ${MAXIMAGESIZE} == "0"
    112   1.8   thorpej FILES=	${PROG}
    113   1.8   thorpej .else
    114   1.8   thorpej FILES=	${PROGSYM}
    115   1.8   thorpej .endif
    116   1.1   thorpej 
    117   1.1   thorpej .include <bsd.prog.mk>
    118   1.7   thorpej 
    119   1.7   thorpej ${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
    120  1.18      matt 	${_MKTARGET_LINK}
    121   1.7   thorpej 	${LD} -o ${.TARGET} ${LDFLAGS} ${STARTFILE} \
    122   1.7   thorpej 	    ${OBJS} ${LIBLIST} > ${BASE}.list
    123