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