Home | History | Annotate | Line # | Download | only in altboot
Makefile revision 1.17
      1 #	$NetBSD: Makefile,v 1.17 2017/04/08 19:53:22 christos 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
     12 CLEANFILES+=	${PROG} ${PROG}.bin ${PROG}.img
     13 CFLAGS+=	-Wall -Wno-main -ffreestanding
     14 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -msoft-float :}
     15 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     16 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
     17 #CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
     18 #CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
     19 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
     20 DBG=		-Os
     21 
     22 .include <bsd.own.mk>
     23 .include <bsd.klinks.mk>
     24 
     25 # XXX SHOULD NOT NEED TO DEFINE THESE!
     26 LIBCRT0=
     27 LIBCRTI=
     28 LIBC=
     29 LIBCRTBEGIN=
     30 LIBCRTEND=
     31 
     32 STRIPFLAG=
     33 BINMODE=	444
     34 
     35 RELOC=		1000000
     36 ENTRY=		_start
     37 
     38 ### find out what to use for libkern
     39 KERN_AS=	library
     40 .include "${S}/lib/libkern/Makefile.inc"
     41 LIBKERN=	${KERNLIB}
     42 
     43 ### find out what to use for libz
     44 Z_AS=		library
     45 .include "${S}/lib/libz/Makefile.inc"
     46 LIBZ=		${ZLIB}
     47 
     48 ### find out what to use for libsa
     49 SA_AS=		library
     50 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     51 .include "${S}/lib/libsa/Makefile.inc"
     52 LIBSA=		${SALIB}
     53 
     54 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     55 	${_MKTARGET_LINK}
     56 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
     57 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     58 	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
     59 	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
     60 	    -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
     61 
     62 VERSIONFLAGS+=-k
     63 .include "${S}/conf/newvers_stand.mk"
     64 
     65 .include <bsd.prog.mk>
     66