Home | History | Annotate | Line # | Download | only in boot2440
Makefile revision 1.7
      1 #	$NetBSD: Makefile,v 1.7 2013/02/06 07:19:19 matt Exp $
      2 
      3 S=		${.CURDIR}/../../../..
      4 
      5 PROG=		bootmini2440
      6 SRCS=		entry.S main.c devopen.c netif.c dev_net.c dm9000.c dev_sdmmc.c
      7 SRCS+=		s3csdi.c vers.c
      8 
      9 .include <bsd.own.mk>
     10 
     11 CLEANFILES+=	vers.c ${PROG}.elf
     12 CFLAGS+=	-Wall -Wno-main -ffreestanding
     13 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
     14 CPPFLAGS+=	-DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 
     15 CPPFLAGS+=	-DDEFAULT_BOOTFILE="ld0a:netbsd;net:"
     16 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch
     17 CPPFLAGS+=	-march=armv4 -mabi=apcs-gnu -mfloat-abi=soft
     18 DBG=		
     19 
     20 LIBCRT0=	# nothing
     21 LIBCRTBEGIN=	# nothing
     22 LIBCRTEND=	# nothing
     23 LIBC=		# nothing
     24 
     25 MAN=		# no manual page
     26 NOMAN=		# defined
     27 STRIPFLAG=
     28 BINMODE=	444
     29 
     30 RELOC=		0x30A00000
     31 ENTRY=		_start
     32 
     33 .if !make(obj) && !make(clean) && !make(cleandir)
     34 .BEGIN:
     35 	@[ -h machine ] || ln -s ${S}/arch/evbarm/include machine
     36 	@[ -h arm ] || ln -s ${S}/arch/arm/include arm
     37 .NOPATH: machine arm
     38 .endif
     39 CLEANFILES+= machine arm
     40 
     41 ### find out what to use for libkern
     42 KERN_AS=	library
     43 .include "${S}/lib/libkern/Makefile.inc"
     44 LIBKERN=	${KERNLIB}
     45 
     46 ### find out what to use for libz
     47 Z_AS=		library
     48 .include "${S}/lib/libz/Makefile.inc"
     49 LIBZ=		${ZLIB}
     50 
     51 ### find out what to use for libsa
     52 SA_AS=		library
     53 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     54 .include "${S}/lib/libsa/Makefile.inc"
     55 LIBSA=		${SALIB}
     56 
     57 .PHONY: vers.c
     58 vers.c: version
     59 	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
     60 	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "evbarm"
     61 
     62 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     63 	${_MKTARGET_LINK}
     64 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.elf \
     65 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     66 	${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET}
     67 
     68 .include <bsd.prog.mk>
     69