Home | History | Annotate | Line # | Download | only in gzboot
Makefile.gzboot revision 1.36
      1  1.36  christos #	$NetBSD: Makefile.gzboot,v 1.36 2017/04/08 19:53:20 christos Exp $
      2   1.1   thorpej 
      3   1.1   thorpej NOMAN=  # defined
      4   1.1   thorpej 
      5  1.33  christos .include <bsd.init.mk>		# Pull in OBJDIR name rules.
      6   1.1   thorpej .include <bsd.own.mk>
      7  1.25      matt .include <bsd.klinks.mk>
      8   1.1   thorpej 
      9   1.1   thorpej EVBARM_STAND=	${S}/arch/evbarm/stand
     10   1.1   thorpej 
     11   1.1   thorpej BASE=	gzboot_${PLATFORM}_${RELOC}
     12   1.7   thorpej PROGSYM=${BASE}.sym
     13   1.7   thorpej PROG=	${BASE}.bin
     14   1.1   thorpej WARNS=	1
     15   1.1   thorpej 
     16   1.1   thorpej NEWVERSWHAT=	"Gzip Boot"
     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.30   tsutsui LIBCRTI=
     24   1.1   thorpej LIBC=
     25   1.1   thorpej LIBCRTBEGIN= 
     26   1.1   thorpej LIBCRTEND=      
     27  1.31    martin STRIPFLAG=
     28   1.1   thorpej 
     29   1.1   thorpej .PATH: ${EVBARM_STAND}/gzboot
     30   1.1   thorpej .PATH: ${EVBARM_STAND}/board
     31   1.1   thorpej 
     32   1.4   thorpej SRCS+=	gzboot.c image.S
     33   1.1   thorpej 
     34   1.1   thorpej STARTFILE= srtbegin.o
     35   1.1   thorpej 
     36   1.1   thorpej CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board
     37   1.1   thorpej CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa
     38  1.15   tsutsui CPPFLAGS+= -I${S}/../common/dist/zlib
     39  1.29     joerg CPPFLAGS+= ${ARM_APCS_FLAGS}
     40  1.28     joerg CPPFLAGS+=	-marm
     41   1.3   thorpej 
     42   1.1   thorpej CPPFLAGS+= -D_STANDALONE
     43   1.5   thorpej 
     44   1.5   thorpej # Specify the heap size (used by board mem_init() routines)
     45  1.14        he CPPFLAGS+= -DBOARD_HEAP_SIZE=1048576		# 1M
     46   1.3   thorpej 
     47   1.3   thorpej # libsa options
     48   1.1   thorpej CPPFLAGS+= -DHEAP_VARIABLE
     49   1.3   thorpej 
     50   1.3   thorpej CPPFLAGS+= -DRELOC=${RELOC}
     51   1.3   thorpej CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
     52   1.3   thorpej CPPFLAGS+= -DLOADADDR=${LOADADDR}
     53   1.1   thorpej 
     54   1.1   thorpej COPTS+=	-ffreestanding
     55  1.20   khorben COPTS+=	-fno-stack-protector
     56  1.23      matt COPTS+=	-fno-unwind-tables
     57  1.15   tsutsui CWARNFLAGS+= -Werror
     58  1.15   tsutsui CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     59   1.1   thorpej 
     60  1.36  christos CLEANFILES+= ${STARTFILE} ${BASE}.list
     61   1.8   thorpej CLEANFILES+= ${PROGSYM}
     62   1.1   thorpej 
     63   1.1   thorpej ### find out what to use for libkern
     64   1.1   thorpej KERN_AS=	library
     65   1.1   thorpej .include "${S}/lib/libkern/Makefile.inc"
     66   1.1   thorpej LIBKERN=	${KERNLIB}
     67   1.1   thorpej 
     68   1.1   thorpej ### find out what to use for libz
     69   1.1   thorpej Z_AS=		library
     70   1.1   thorpej .include "${S}/lib/libz/Makefile.inc"
     71   1.1   thorpej LIBZ=		${ZLIB}
     72   1.1   thorpej 
     73   1.1   thorpej ### find out what to use for libsa
     74   1.1   thorpej SA_AS=		library
     75   1.1   thorpej .include "${S}/lib/libsa/Makefile.inc"
     76   1.1   thorpej LIBSA=		${SALIB}
     77   1.1   thorpej 
     78  1.16  dholland cleandir distclean: .WAIT cleanlibdir
     79   1.1   thorpej 
     80   1.1   thorpej cleanlibdir:
     81  1.10       jmc 	-rm -rf lib
     82   1.1   thorpej 
     83  1.34     joerg DIRECT_LDFLAGS= -M -T ${LDSCRIPT} --fix-v4bx
     84   1.1   thorpej 
     85   1.1   thorpej LIBLIST=${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
     86   1.1   thorpej 
     87  1.36  christos .include "${S}/conf/newvers_stand.mk"
     88   1.1   thorpej 
     89   1.7   thorpej ${PROG}: ${PROGSYM}
     90   1.7   thorpej 	${OBJCOPY} -O binary ${PROGSYM} ${.TARGET}
     91   1.8   thorpej 
     92   1.8   thorpej # Prevent the normal install target from doing anything.
     93   1.8   thorpej proginstall::
     94   1.8   thorpej 
     95   1.8   thorpej # Install the raw binary or the symbol version, based on whether or
     96   1.8   thorpej # not the resulting gzboot needs to be mdsetimage'd.
     97   1.8   thorpej .if ${MAXIMAGESIZE} == "0"
     98   1.8   thorpej FILES=	${PROG}
     99   1.8   thorpej .else
    100   1.8   thorpej FILES=	${PROGSYM}
    101   1.8   thorpej .endif
    102   1.1   thorpej 
    103   1.1   thorpej .include <bsd.prog.mk>
    104   1.7   thorpej 
    105   1.7   thorpej ${PROGSYM}: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
    106  1.18      matt 	${_MKTARGET_LINK}
    107  1.34     joerg 	${LD} -o ${.TARGET} ${DIRECT_LDFLAGS} ${STARTFILE} \
    108   1.7   thorpej 	    ${OBJS} ${LIBLIST} > ${BASE}.list
    109