1 # $NetBSD: Makefile,v 1.21 2008/10/19 22:05:21 apb 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 -DINSECURE # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG -DARP_DEBUG 29 WARNS=1 30 CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS} 31 # XXX SHOULD NOT NEED TO DEFINE THESE! 32 LIBCRT0= 33 LIBC= 34 LIBCRTBEGIN= 35 LIBCRTEND= 36 37 PROG= boot 38 SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c vers.c build.c 39 40 # @@@ dev_net.c should really be in libsa, but it doesn't 41 # declare ip_convertaddr correctly, so I put it here _temporarily_. 42 .PATH: ${S}/lib/libsa 43 SRCS+= dev_net.c 44 45 CLEANFILES+= srt0.o boot.elf boot.raw machine ${MACHINE_ARCH} limits.h 46 CLEANFILES+= vers.c build.c build # generated dynamically 47 48 BINDIR= /usr/mdec 49 #LIBS= ${SALIB} ${KERNLIB} ${ZLIB} 50 LIBS= ${SALIB} ${KERNLIB} 51 52 # do not strip ${PROG} on install 53 STRIPFLAG= # defined 54 55 AWKPROG='\ 56 function x(v) { printf "\\0\\%o\\%o\\%o", (v / 65536) % 256, (v / 256) % 256, v % 256 } \ 57 { \ 58 printf "\047\\0\\207\\01\\07"; \ 59 x($$1); \ 60 x($$2); \ 61 x($$3); \ 62 printf "\\0\\0\\0\\0\\04\\070\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\047" \ 63 }' 64 65 ${PROG}: srt0.o ${OBJS} ${LIBS} 66 ${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf 67 ${SIZE} $@.elf 68 ${OBJCOPY} -O binary $@.elf $@.raw 69 (${SIZE} $@.elf | tail +2 | ${TOOL_AWK} ${AWKPROG} | \ 70 xargs printf ; cat $@.raw) > $@ 71 72 # startup 73 74 srt0.o: ${.CURDIR}/srt0.s 75 ${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s 76 77 .PHONY: build.c 78 build.c: 79 ${HOST_SH} ${.CURDIR}/newvers.sh 80 81 vers.c: version 82 ${HOST_SH} ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "next68k" 83 84 #installboot: ${.CURDIR}/installboot.sh 85 # @rm -f installboot 86 # cp -p ${.CURDIR}/installboot.sh installboot 87 88 # utilities 89 90 .if !make(obj) && !make(clean) && !make(cleandir) 91 .BEGIN: 92 rm -f machine 93 ln -s ${S}/arch/${MACHINE}/include machine 94 rm -f ${MACHINE_ARCH} 95 ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} 96 .endif 97 98 .include <bsd.prog.mk> 99