Home | History | Annotate | Line # | Download | only in altboot
      1 #	$NetBSD: Makefile,v 1.19 2024/02/09 16:12:02 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 cleandir distclean: .WAIT cleanlibdir
     55 
     56 cleanlibdir:
     57 	-rm -rf lib
     58 
     59 .if ${MKREPRO_TIMESTAMP:Uno} != "no"
     60 MKUBOOTIMAGE_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}"
     61 .endif
     62 
     63 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     64 	${_MKTARGET_LINK}
     65 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
     66 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     67 	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
     68 	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
     69 	    -a 0x${RELOC} ${MKUBOOTIMAGE_TIMESTAMP} -n ${PROG} \
     70 	    ${PROG}.bin ${PROG}.img
     71 
     72 
     73 VERSIONFLAGS+=-k
     74 .include "${S}/conf/newvers_stand.mk"
     75 
     76 .include <bsd.prog.mk>
     77