1 # $NetBSD: Makefile,v 1.12 2002/05/08 11:27:30 jdolecek 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 # XXX make defs arch-indep. 24 INCLUDES+= -I${.OBJDIR} -I${S}/arch -I${S} -I${S}/lib/libsa 25 DEFS+= -D_STANDALONE -DMC68040 -DSUPPORT_BOOTP -DSUPPORT_DHCP -DDEBUG -DSD_DEBUG -DSCSI_DEBUG # -DEN_DEBUG -DNETIF_DEBUG 26 SAMISCCPPFLAGS= -DSUPPORT_DHCP -DSUPPORT_BOOTP -DINSECURE # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG -DARP_DEBUG 27 WARNS=1 28 CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS} 29 LIBCRT0= 30 31 PROG= boot 32 SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c vers.c build.c 33 34 # @@@ dev_net.c should really be in libsa, but it doesn't 35 # declare ip_convertaddr correctly, so I put it here _temporarily_. 36 .PATH: ${S}/lib/libsa 37 SRCS+= dev_net.c 38 39 CLEANFILES+= srt0.o boot.elf boot.raw machine ${MACHINE_ARCH} limits.h 40 CLEANFILES+= vers.c build.c build # generated dynamically 41 42 NOMAN= # defined 43 BINDIR= /usr/mdec 44 #LIBS= ${SALIB} ${KERNLIB} ${ZLIB} 45 LIBS= ${SALIB} ${KERNLIB} 46 47 AWKPROG='\ 48 function x(v) { printf "\0%c%c%c", v / 65536, v / 256, v } \ 49 { \ 50 printf "\0\207\01\07"; \ 51 x($$1); \ 52 x($$2); \ 53 x($$3); \ 54 printf "\0\0\0\0\04\070\0\0\0\0\0\0\0\0\0\0" \ 55 }' 56 57 ${PROG}: srt0.o ${OBJS} ${LIBS} 58 ${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf 59 @${SIZE} $@.elf 60 @${OBJCOPY} -O binary $@.elf $@.raw 61 @(${SIZE} $@.elf | tail +2 | awk ${AWKPROG} ; cat $@.raw) > $@ 62 63 # startup 64 65 srt0.o: ${.CURDIR}/srt0.s 66 ${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s 67 68 .PHONY: build.c 69 build.c: 70 sh ${.CURDIR}/newvers.sh 71 72 vers.c: version 73 sh ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "next68k" 74 75 #installboot: ${.CURDIR}/installboot.sh 76 # @rm -f installboot 77 # cp -p ${.CURDIR}/installboot.sh installboot 78 79 # utilities 80 81 .if !make(obj) && !make(clean) && !make(cleandir) 82 .BEGIN: 83 rm -f machine 84 ln -s ${S}/arch/${MACHINE}/include machine 85 rm -f ${MACHINE_ARCH} 86 ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} 87 .endif 88 89 .include <bsd.prog.mk> 90