1 # $NetBSD: Makefile,v 1.15 2002/09/11 01:46:36 mycroft Exp $ 2 3 S= ${.CURDIR}/../../../.. 4 5 ### find out what to use for libkern 6 KERN_AS= library 7 .include "${S}/lib/libkern/Makefile.inc" 8 #LIBKERN= ${KERNLIB} 9 10 ### find out what to use for libz 11 Z_AS= library 12 .include "${S}/lib/libz/Makefile.inc" 13 #LIBZ= ${ZLIB} 14 15 ### find out what to use for libsa 16 SA_AS= library 17 SAMISCMAKEFLAGS= SA_USE_LOADFILE=yes # SA_USE_CREAD=yes 18 .include "${S}/lib/libsa/Makefile.inc" 19 #LIBSA= ${SALIB} 20 21 RELOC= 4380000 22 23 DEFS+= -DDISABLE_NEXT_BMAP_CHIP 24 DEFS+= -g 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 -DINSECURE # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG -DARP_DEBUG 29 WARNS=1 30 CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS} 31 LIBCRT0= 32 33 PROG= boot 34 SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c vers.c build.c 35 36 # @@@ dev_net.c should really be in libsa, but it doesn't 37 # declare ip_convertaddr correctly, so I put it here _temporarily_. 38 .PATH: ${S}/lib/libsa 39 SRCS+= dev_net.c 40 41 CLEANFILES+= srt0.o boot.elf boot.raw machine ${MACHINE_ARCH} limits.h 42 CLEANFILES+= vers.c build.c build # generated dynamically 43 44 NOMAN= # defined 45 BINDIR= /usr/mdec 46 #LIBS= ${SALIB} ${KERNLIB} ${ZLIB} 47 LIBS= ${SALIB} ${KERNLIB} 48 49 # do not strip ${PROG} on install 50 STRIPFLAG= # defined 51 52 AWKPROG='\ 53 function x(v) { printf "\\0\\%o\\%o\\%o", (v / 65536) % 256, (v / 256) % 256, v % 256 } \ 54 { \ 55 printf "\047\\0\\207\\01\\07"; \ 56 x($$1); \ 57 x($$2); \ 58 x($$3); \ 59 printf "\\0\\0\\0\\0\\04\\070\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\047" \ 60 }' 61 62 ${PROG}: srt0.o ${OBJS} ${LIBS} 63 ${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf 64 ${SIZE} $@.elf 65 ${OBJCOPY} -O binary $@.elf $@.raw 66 (${SIZE} $@.elf | tail +2 | awk ${AWKPROG} | xargs printf ; cat $@.raw) > $@ 67 68 # startup 69 70 srt0.o: ${.CURDIR}/srt0.s 71 ${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s 72 73 .PHONY: build.c 74 build.c: 75 sh ${.CURDIR}/newvers.sh 76 77 vers.c: version 78 sh ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "next68k" 79 80 #installboot: ${.CURDIR}/installboot.sh 81 # @rm -f installboot 82 # cp -p ${.CURDIR}/installboot.sh installboot 83 84 # utilities 85 86 .if !make(obj) && !make(clean) && !make(cleandir) 87 .BEGIN: 88 rm -f machine 89 ln -s ${S}/arch/${MACHINE}/include machine 90 rm -f ${MACHINE_ARCH} 91 ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} 92 .endif 93 94 .include <bsd.prog.mk> 95