Home | History | Annotate | Line # | Download | only in boot_ufs
Makefile revision 1.6
      1  1.6  minoura #	$NetBSD: Makefile,v 1.6 2001/10/15 16:23:01 minoura Exp $
      2  1.3  minoura 
      3  1.3  minoura .include <bsd.own.mk>
      4  1.1  minoura 
      5  1.1  minoura BOOT=	boot_ufs
      6  1.6  minoura VERSIONFILE=	${.CURDIR}/version
      7  1.6  minoura VERSION!=	awk -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } END { print it }' ${VERSIONFILE}
      8  1.6  minoura NEWVERSWHAT=	"${BOOT}"
      9  1.1  minoura 
     10  1.1  minoura # text and bss addresses in hex
     11  1.1  minoura TEXT=		0f0000		# Primary (me)
     12  1.1  minoura BOOT_TEXT=	006000		# Secondary (/boot)
     13  1.1  minoura 
     14  1.5  minoura PROG=		xx$(BOOT)
     15  1.5  minoura LINKS=		${BINDIR}/xx$(BOOT) ${BINDIR}/sd$(BOOT)
     16  1.5  minoura LINKS=		${BINDIR}/xx$(BOOT) ${BINDIR}/fd$(BOOT)
     17  1.1  minoura BINDIR=		/usr/mdec
     18  1.1  minoura STRIPFLAG=
     19  1.1  minoura BINMODE=	444
     20  1.1  minoura MKMAN=		no
     21  1.1  minoura 
     22  1.1  minoura OBJCOPY?=	objcopy
     23  1.1  minoura 
     24  1.6  minoura S=		${.CURDIR}/../../../..
     25  1.6  minoura M=		$S/arch/${MACHINE}
     26  1.6  minoura LIBKERN=	$S/lib/libkern/arch/${MACHINE_ARCH}
     27  1.6  minoura COMMONDIR=	$M/stand/common
     28  1.6  minoura LIBIOCS=	$M/stand/libiocs
     29  1.1  minoura .PATH:		${LIBKERN} ${COMMONDIR}
     30  1.1  minoura SRCS=	boot.S bootmain.c readufs.c readufs_ffs.c #readufs_lfs.c
     31  1.1  minoura SRCS+=	exec_image.S memset.S strcmp.S
     32  1.6  minoura 
     33  1.6  minoura SRCS+=		vers.c
     34  1.6  minoura CLEANFILES+=	vers.c
     35  1.6  minoura vers.c:	${VERSIONFILE}
     36  1.6  minoura 	sh ${S}/conf/newvers_stand.sh -DM ${.ALLSRC} ${MACHINE} ${NEWVERSWHAT}
     37  1.1  minoura 
     38  1.1  minoura CFLAGS=	-Os -fomit-frame-pointer
     39  1.1  minoura CFLAGS+= -W -Wall -Wconversion -Wstrict-prototypes -Wmissing-prototypes
     40  1.1  minoura CPPFLAGS+= -DTEXTADDR="0x$(TEXT)" -DBOOT_TEXTADDR="0x$(BOOT_TEXT)"
     41  1.1  minoura CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
     42  1.1  minoura CPPFLAGS+= -DSCSI_ADHOC_BOOTPART
     43  1.1  minoura #CPPFLAGS+= -DBOOT_DEBUG
     44  1.1  minoura CPPFLAGS+= -DUSE_FFS #-DUSE_LFS
     45  1.2  minoura CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS}
     46  1.1  minoura AFLAGS=	   ${CFLAGS:M-[ID]*}
     47  1.3  minoura .if ${OBJECT_FMT} == "ELF"
     48  1.1  minoura LDFLAGS=   -N -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
     49  1.1  minoura LDFLAGS+=  -noinhibit-exec	# XXX
     50  1.3  minoura .else
     51  1.3  minoura LDFLAGS=   -n -Bstatic -Ttext ${TEXT}
     52  1.3  minoura .endif
     53  1.1  minoura 
     54  1.5  minoura CLEANFILES=	$(PROG).x s.x x.s x.o
     55  1.1  minoura 
     56  1.1  minoura 
     57  1.5  minoura $(PROG): $(OBJS)
     58  1.5  minoura 	$(LD) $(LDFLAGS) -o $(PROG).x $(OBJS) $(LDADD)
     59  1.5  minoura 	@$(NM) --target=a.out-m68k-netbsd $(PROG).x | sed -n '/T first_kbyte/p'
     60  1.1  minoura 	@if [ `(echo ibase=16; \
     61  1.5  minoura 		$(NM) --target=a.out-m68k-netbsd $(PROG).x | sed -n 's/T first_kbyte/-$(TEXT)-400/p' | \
     62  1.1  minoura 				tr a-f A-F) | bc` -gt 0 ];\
     63  1.5  minoura 	then echo '$(PROG): first_kbyte exceeds the first killobyte'; exit 1; fi
     64  1.5  minoura 	@$(SIZE) --target=a.out-m68k-netbsd $(PROG).x
     65  1.1  minoura 	@if [ `(echo ibase=16; \
     66  1.5  minoura 		$(NM) --target=a.out-m68k-netbsd $(PROG).x | sed -n 's/D _edata/-$(TEXT)-2000/p' | tr a-f A-F) |\
     67  1.1  minoura 			bc` -gt 0 ];\
     68  1.5  minoura 	then	echo '$(PROG): text+data is too large'; exit 1; fi
     69  1.5  minoura 	@cp $(PROG).x s.x
     70  1.5  minoura 	@$(OBJCOPY) -I a.out-m68k-netbsd -O binary s.x $(PROG)
     71  1.1  minoura 	@rm s.x
     72  1.1  minoura 
     73  1.1  minoura .include <bsd.prog.mk>
     74