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