1 1.19 christos # $NetBSD: Makefile,v 1.19 2024/02/09 16:12:02 christos Exp $ 2 1.1 nisimura 3 1.1 nisimura S= ${.CURDIR}/../../../.. 4 1.1 nisimura 5 1.1 nisimura PROG= altboot 6 1.8 phx FILES+= ${PROG}.bin ${PROG}.img 7 1.4 nisimura NOMAN= # defined 8 1.10 phx SRCS= entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c 9 1.10 phx SRCS+= nif.c fxp.c tlp.c rge.c skg.c stg.c 10 1.10 phx SRCS+= dsk.c pciide.c siisata.c 11 1.17 christos SRCS+= exception.c 12 1.17 christos CLEANFILES+= ${PROG} ${PROG}.bin ${PROG}.img 13 1.16 joerg CFLAGS+= -Wall -Wno-main -ffreestanding 14 1.16 joerg CFLAGS+= ${${ACTIVE_CC} == "gcc":? -msoft-float :} 15 1.1 nisimura CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 16 1.11 phx CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT 17 1.1 nisimura #CPPFLAGS+= -DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200 18 1.1 nisimura #CPPFLAGS+= -DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600 19 1.1 nisimura CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} 20 1.1 nisimura DBG= -Os 21 1.1 nisimura 22 1.4 nisimura .include <bsd.own.mk> 23 1.13 matt .include <bsd.klinks.mk> 24 1.4 nisimura 25 1.1 nisimura # XXX SHOULD NOT NEED TO DEFINE THESE! 26 1.1 nisimura LIBCRT0= 27 1.14 tsutsui LIBCRTI= 28 1.1 nisimura LIBC= 29 1.1 nisimura LIBCRTBEGIN= 30 1.1 nisimura LIBCRTEND= 31 1.1 nisimura 32 1.1 nisimura STRIPFLAG= 33 1.1 nisimura BINMODE= 444 34 1.1 nisimura 35 1.1 nisimura RELOC= 1000000 36 1.1 nisimura ENTRY= _start 37 1.1 nisimura 38 1.1 nisimura ### find out what to use for libkern 39 1.1 nisimura KERN_AS= library 40 1.1 nisimura .include "${S}/lib/libkern/Makefile.inc" 41 1.1 nisimura LIBKERN= ${KERNLIB} 42 1.1 nisimura 43 1.1 nisimura ### find out what to use for libz 44 1.1 nisimura Z_AS= library 45 1.1 nisimura .include "${S}/lib/libz/Makefile.inc" 46 1.1 nisimura LIBZ= ${ZLIB} 47 1.1 nisimura 48 1.1 nisimura ### find out what to use for libsa 49 1.1 nisimura SA_AS= library 50 1.1 nisimura SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 51 1.1 nisimura .include "${S}/lib/libsa/Makefile.inc" 52 1.1 nisimura LIBSA= ${SALIB} 53 1.1 nisimura 54 1.18 rin cleandir distclean: .WAIT cleanlibdir 55 1.18 rin 56 1.18 rin cleanlibdir: 57 1.18 rin -rm -rf lib 58 1.18 rin 59 1.19 christos .if ${MKREPRO_TIMESTAMP:Uno} != "no" 60 1.19 christos MKUBOOTIMAGE_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}" 61 1.19 christos .endif 62 1.19 christos 63 1.1 nisimura ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 64 1.13 matt ${_MKTARGET_LINK} 65 1.1 nisimura ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 66 1.6 phx ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 67 1.8 phx ${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin 68 1.8 phx ${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \ 69 1.19 christos -a 0x${RELOC} ${MKUBOOTIMAGE_TIMESTAMP} -n ${PROG} \ 70 1.19 christos ${PROG}.bin ${PROG}.img 71 1.19 christos 72 1.1 nisimura 73 1.17 christos VERSIONFLAGS+=-k 74 1.17 christos .include "${S}/conf/newvers_stand.mk" 75 1.17 christos 76 1.1 nisimura .include <bsd.prog.mk> 77