Home | History | Annotate | Line # | Download | only in altboot
Makefile revision 1.12.16.1
      1 #	$NetBSD: Makefile,v 1.12.16.1 2013/08/28 23:59:21 rmind Exp $
      2 
      3 S=		${.CURDIR}/../../../..
      4 
      5 PROG=		altboot
      6 FILES+=		${PROG}.bin ${PROG}.img
      7 NOMAN=		# defined
      8 SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c
      9 SRCS+=		nif.c fxp.c tlp.c rge.c skg.c stg.c
     10 SRCS+=		dsk.c pciide.c siisata.c
     11 SRCS+=		exception.c vers.c
     12 CLEANFILES+=	vers.c ${PROG} ${PROG}.bin ${PROG}.img
     13 CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
     14 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     15 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
     16 #CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
     17 #CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
     18 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
     19 DBG=		-Os
     20 
     21 .include <bsd.own.mk>
     22 .include <bsd.klinks.mk>
     23 
     24 # XXX SHOULD NOT NEED TO DEFINE THESE!
     25 LIBCRT0=
     26 LIBC=
     27 LIBCRTBEGIN=
     28 LIBCRTEND=
     29 
     30 STRIPFLAG=
     31 BINMODE=	444
     32 
     33 RELOC=		1000000
     34 ENTRY=		_start
     35 
     36 ### find out what to use for libkern
     37 KERN_AS=	library
     38 .include "${S}/lib/libkern/Makefile.inc"
     39 LIBKERN=	${KERNLIB}
     40 
     41 ### find out what to use for libz
     42 Z_AS=		library
     43 .include "${S}/lib/libz/Makefile.inc"
     44 LIBZ=		${ZLIB}
     45 
     46 ### find out what to use for libsa
     47 SA_AS=		library
     48 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     49 .include "${S}/lib/libsa/Makefile.inc"
     50 LIBSA=		${SALIB}
     51 
     52 .PHONY: vers.c
     53 vers.c: version
     54 	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
     55 	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "sandpoint"
     56 
     57 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     58 	${_MKTARGET_LINK}
     59 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
     60 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     61 	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
     62 	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
     63 	    -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
     64 
     65 .include <bsd.prog.mk>
     66