1 # $NetBSD: Makefile,v 1.29 2017/04/08 19:53:22 christos Exp $ 2 3 NOMAN= # defined 4 5 S= ${.CURDIR}/../../../.. 6 7 ### find out what to use for libkern 8 KERN_AS= library 9 .include "${S}/lib/libkern/Makefile.inc" 10 #LIBKERN= ${KERNLIB} 11 12 ### find out what to use for libz 13 Z_AS= library 14 .include "${S}/lib/libz/Makefile.inc" 15 #LIBZ= ${ZLIB} 16 17 ### find out what to use for libsa 18 SA_AS= library 19 SAMISCMAKEFLAGS= SA_USE_LOADFILE=yes # SA_USE_CREAD=yes 20 .include "${S}/lib/libsa/Makefile.inc" 21 #LIBSA= ${SALIB} 22 23 RELOC= 4380000 24 25 # XXX make defs arch-indep. 26 INCLUDES+= -I${.OBJDIR} -I${S}/arch -I${S} -I${S}/lib/libsa 27 DEFS+= -D_STANDALONE -DMC68040 -DSUPPORT_BOOTP -DSUPPORT_DHCP -DDEBUG -DSD_DEBUG -DSCSI_DEBUG # -DEN_DEBUG -DNETIF_DEBUG 28 SAMISCCPPFLAGS= -DSUPPORT_DHCP -DSUPPORT_BOOTP -DSA_EXEC_ANYOWNER # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG -DARP_DEBUG 29 WARNS=1 30 CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS} 31 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 32 AFLAGS+= ${INCLUDES} 33 # XXX SHOULD NOT NEED TO DEFINE THESE! 34 LIBCRT0= 35 LIBCRTI= 36 LIBC= 37 LIBCRTBEGIN= 38 LIBCRTEND= 39 40 PROG= boot 41 SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c build.c 42 43 # @@@ dev_net.c should really be in libsa, but it doesn't 44 # declare ip_convertaddr correctly, so I put it here _temporarily_. 45 .PATH: ${S}/lib/libsa 46 SRCS+= dev_net.c 47 48 CLEANFILES+= srt0.o boot.elf boot.raw limits.h 49 CLEANFILES+= build.c build # generated dynamically 50 51 BINDIR= /usr/mdec 52 #LIBS= ${SALIB} ${KERNLIB} ${ZLIB} 53 LIBS= ${SALIB} ${KERNLIB} 54 55 # do not strip ${PROG} on install 56 STRIPFLAG= # defined 57 58 AWKPROG='\ 59 function x(v) { printf "\\0\\%o\\%o\\%o", (v / 65536) % 256, (v / 256) % 256, v % 256 } \ 60 { \ 61 printf "\047\\0\\207\\01\\07"; \ 62 x($$1); \ 63 x($$2); \ 64 x($$3); \ 65 printf "\\0\\0\\0\\0\\04\\070\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\047" \ 66 }' 67 68 ${PROG}: srt0.o ${OBJS} ${LIBS} 69 ${_MKTARGET_LINK} 70 ${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf 71 ${SIZE} $@.elf 72 ${OBJCOPY} -O binary $@.elf $@.raw 73 (${SIZE} $@.elf | tail +2 | ${TOOL_AWK} ${AWKPROG} | \ 74 xargs printf ; cat $@.raw) > $@ 75 76 # startup 77 78 srt0.o: ${.CURDIR}/srt0.s 79 ${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s 80 81 .PHONY: build.c 82 build.c: 83 ${HOST_SH} ${.CURDIR}/newvers.sh 84 85 .include "${S}/conf/newvers_stand.mk" 86 87 #installboot: ${.CURDIR}/installboot.sh 88 # @rm -f installboot 89 # cp -p ${.CURDIR}/installboot.sh installboot 90 91 # utilities 92 93 .include <bsd.prog.mk> 94 .include <bsd.klinks.mk> 95