Home | History | Annotate | Line # | Download | only in altboot
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 2011/01/23 01:05:30 nisimura Exp $
      2 
      3 S=		${.CURDIR}/../../../..
      4 
      5 PROG=		altboot
      6 SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c nif.c \
      7 		fxp.c tlp.c rge.c skg.c dsk.c pciide.c siisata.c printf.c
      8 CLEANFILES+=	vers.c vers.o ${PROG} ${PROG}.bin
      9 CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
     10 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     11 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
     12 #CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
     13 #CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
     14 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
     15 DBG=		-Os
     16 
     17 # XXX SHOULD NOT NEED TO DEFINE THESE!
     18 LIBCRT0=
     19 LIBC=
     20 LIBCRTBEGIN=
     21 LIBCRTEND=
     22 
     23 NOMAN=		# defined
     24 STRIPFLAG=
     25 BINMODE=	444
     26 
     27 RELOC=		1000000
     28 ENTRY=		_start
     29 
     30 
     31 .if !make(obj) && !make(clean) && !make(cleandir)
     32 .BEGIN:
     33 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     34 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     35 .NOPATH: machine powerpc
     36 .endif
     37 CLEANFILES+= machine powerpc
     38 
     39 ### find out what to use for libkern
     40 KERN_AS=	library
     41 .include "${S}/lib/libkern/Makefile.inc"
     42 LIBKERN=	${KERNLIB}
     43 
     44 ### find out what to use for libz
     45 Z_AS=		library
     46 .include "${S}/lib/libz/Makefile.inc"
     47 LIBZ=		${ZLIB}
     48 
     49 ### find out what to use for libsa
     50 SA_AS=		library
     51 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     52 .include "${S}/lib/libsa/Makefile.inc"
     53 LIBSA=		${SALIB}
     54 
     55 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     56 	${HOST_SH} ${.CURDIR}/newvers.sh ${.CURDIR}/version
     57 	${CC} -c vers.c
     58 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
     59 	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
     60 	${OBJCOPY} -S -O binary ${.TARGET} ${.TARGET}.bin
     61 
     62 .include <bsd.prog.mk>
     63 
     64 cleandir distclean: .WAIT cleanlibdir
     65 
     66 cleanlibdir:
     67 	-rm -rf lib
     68