1 1.5.4.2 nathanw # $NetBSD: Makefile,v 1.5.4.2 2002/01/08 00:28:44 nathanw Exp $ 2 1.5.4.2 nathanw 3 1.5.4.2 nathanw NOMAN= # defined 4 1.5.4.2 nathanw 5 1.5.4.2 nathanw .include <bsd.own.mk> 6 1.5.4.2 nathanw 7 1.5.4.2 nathanw BOOT= Multi-boot 8 1.5.4.2 nathanw VERSIONFILE= ${.CURDIR}/version 9 1.5.4.2 nathanw VERSION!= awk -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } END { print it }' ${VERSIONFILE} 10 1.5.4.2 nathanw NEWVERSWHAT= "${BOOT}" 11 1.5.4.2 nathanw 12 1.5.4.2 nathanw # text address 13 1.5.4.2 nathanw TEXT= 006000 14 1.5.4.2 nathanw 15 1.5.4.2 nathanw PROG= boot 16 1.5.4.2 nathanw BINDIR= /usr/mdec 17 1.5.4.2 nathanw BINMODE= 444 18 1.5.4.2 nathanw STRIPFLAG= 19 1.5.4.2 nathanw 20 1.5.4.2 nathanw BFDNAME= a.out-m68k-netbsd 21 1.5.4.2 nathanw STRIP?= /usr/bin/strip 22 1.5.4.2 nathanw OBJCOPY?= /usr/bin/objcopy 23 1.5.4.2 nathanw 24 1.5.4.2 nathanw SRCS= srt0.S boot.c conf.c exec_image.S 25 1.5.4.2 nathanw S= ${.CURDIR}/../../../.. 26 1.5.4.2 nathanw M= $S/arch/${MACHINE} 27 1.5.4.2 nathanw COMMONDIR= $M/stand/common 28 1.5.4.2 nathanw .PATH: ${COMMONDIR} 29 1.5.4.2 nathanw 30 1.5.4.2 nathanw SRCS+= vers.c 31 1.5.4.2 nathanw CLEANFILES+= vers.c 32 1.5.4.2 nathanw vers.c: ${VERSIONFILE} 33 1.5.4.2 nathanw sh ${S}/conf/newvers_stand.sh ${.ALLSRC} ${MACHINE} ${NEWVERSWHAT} 34 1.5.4.2 nathanw 35 1.5.4.2 nathanw CPPFLAGS+= -nostdinc -I$S -I${.OBJDIR} -I$M/stand/libsa 36 1.5.4.2 nathanw CPPFLAGS+= -I$M/stand/libiocs -I${COMMONDIR} 37 1.5.4.2 nathanw CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE 38 1.5.4.2 nathanw CPPFLAGS+= -DTEXTADDR="0x${TEXT}" 39 1.5.4.2 nathanw CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\" 40 1.5.4.2 nathanw CFLAGS= -Wno-main -Os -m68020-60 41 1.5.4.2 nathanw .if ${OBJECT_FMT} == "ELF" 42 1.5.4.2 nathanw LDFLAGS= -N -static -T ${.CURDIR}/boot.ldscript 43 1.5.4.2 nathanw .else 44 1.5.4.2 nathanw LDFLAGS= -N -static -Ttext ${TEXT} 45 1.5.4.2 nathanw .endif 46 1.5.4.2 nathanw LIBIOCS!= cd $M/stand/libiocs && ${PRINTOBJDIR} 47 1.5.4.2 nathanw LIBSA!= cd $M/stand/libsa && ${PRINTOBJDIR} 48 1.5.4.2 nathanw LDLIBS= -L${LIBSA} -lsa -L${LIBIOCS} -liocs 49 1.5.4.2 nathanw 50 1.5.4.2 nathanw .PHONY: machine-links 51 1.5.4.2 nathanw beforedepend: machine-links 52 1.5.4.2 nathanw machine-links: 53 1.5.4.2 nathanw -rm -f machine && \ 54 1.5.4.2 nathanw ln -s $M/include machine 55 1.5.4.2 nathanw -rm -f ${MACHINE_ARCH} && \ 56 1.5.4.2 nathanw ln -s $S/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} 57 1.5.4.2 nathanw CLEANFILES+= machine ${MACHINE_ARCH} 58 1.5.4.2 nathanw 59 1.5.4.2 nathanw realall: machine-links ${PROG} 60 1.5.4.2 nathanw ${PROG}: ${OBJS} 61 1.5.4.2 nathanw ${LD} ${LDFLAGS} -o ${PROG}.sym ${OBJS} ${LDLIBS} 62 1.5.4.2 nathanw ${STRIP} -F ${BFDNAME} -o ${PROG} ${PROG}.sym 63 1.5.4.2 nathanw 64 1.5.4.2 nathanw CLEANFILES+= ${PROG}.sym 65 1.5.4.2 nathanw 66 1.5.4.2 nathanw .include <bsd.prog.mk> 67