Home | History | Annotate | Line # | Download | only in bootxx_ffs
Makefile revision 1.6
      1  1.6       he #	$NetBSD: Makefile,v 1.6 2003/08/24 15:11:19 he Exp $
      2  1.1   mhitch 
      3  1.1   mhitch ### what we need:
      4  1.1   mhitch 
      5  1.1   mhitch DIR_TOP=	${.CURDIR}/../../../../..
      6  1.1   mhitch DIR_SA = 	${DIR_TOP}/lib/libsa
      7  1.1   mhitch DIR_KERN=	${DIR_TOP}/lib/libkern
      8  1.1   mhitch DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
      9  1.1   mhitch 
     10  1.1   mhitch .PATH:  ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD)
     11  1.1   mhitch 
     12  1.1   mhitch # prefer our assembler versions over assembler, and assembler over C:
     13  1.1   mhitch 
     14  1.1   mhitch .SUFFIXES:
     15  1.1   mhitch .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
     16  1.1   mhitch 
     17  1.1   mhitch FILES= bootxx_ffs bootxx_fd
     18  1.1   mhitch BINDIR=/usr/mdec
     19  1.1   mhitch 
     20  1.1   mhitch COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
     21  1.1   mhitch COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
     22  1.3   mhitch COBJS+=  ufs.o ustarfs.o panic.o vers.o files.o
     23  1.1   mhitch 
     24  1.1   mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
     25  1.1   mhitch SOBJS += strlen.o strcmp.o fstat.o
     26  1.6       he SOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o
     27  1.1   mhitch 
     28  1.1   mhitch OBJS=	$(SOBJS) $(COBJS)
     29  1.1   mhitch 
     30  1.1   mhitch DEFS = -D_STANDALONE -DINSECURE -D_PRIMARY_BOOT
     31  1.1   mhitch 
     32  1.1   mhitch .NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o
     33  1.1   mhitch 
     34  1.1   mhitch ### main target: ###
     35  1.1   mhitch 
     36  1.1   mhitch realall: machine m68k ${FILES}
     37  1.1   mhitch 
     38  1.1   mhitch CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k
     39  1.1   mhitch 
     40  1.1   mhitch .include <bsd.prog.mk>
     41  1.1   mhitch 
     42  1.1   mhitch ### special  rules for bootblocks ###
     43  1.1   mhitch 
     44  1.1   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     45  1.1   mhitch INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
     46  1.1   mhitch INCPATH += -I${.CURDIR}/../aout2bb -I$(.CURDIR) -I${DESTDIR}/usr/include
     47  1.1   mhitch 
     48  1.1   mhitch AFLAGS += -m68030 -l
     49  1.1   mhitch CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT
     50  1.1   mhitch 
     51  1.1   mhitch COPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks  -Wa,-l -m68060 -Wa,-m68030
     52  1.4  thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     53  1.1   mhitch 
     54  1.1   mhitch NETBSD_VERS!=	sh ${.CURDIR}/../../../../../conf/osrelease.sh
     55  1.1   mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     56  1.5   mhitch 
     57  1.5   mhitch # Use small daddr_t to avoid code bloat
     58  1.5   mhitch DEFS+=	-D__daddr_t=int32_t
     59  1.1   mhitch 
     60  1.1   mhitch .c.o:
     61  1.1   mhitch 	${CC} ${CFLAGS} -S $< -o $*.s
     62  1.1   mhitch 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     63  1.1   mhitch 	rm $*.s
     64  1.1   mhitch 
     65  1.1   mhitch .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     66  1.1   mhitch 
     67  1.1   mhitch .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     68  1.1   mhitch 
     69  1.1   mhitch bootxx_ffs: x.out
     70  1.1   mhitch 	${RELOC2BB} x.out $@ || ${NM} -u x.out
     71  1.1   mhitch 
     72  1.1   mhitch bootxx_fd: f.out
     73  1.1   mhitch 	${RELOC2BB} -F f.out $@ || ${NM} -u f.out
     74  1.1   mhitch 
     75  1.1   mhitch x.out: xxstart.o libboot.a
     76  1.1   mhitch 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     77  1.1   mhitch 	${SIZE} $@
     78  1.1   mhitch 	${NM} -u $@
     79  1.1   mhitch 
     80  1.1   mhitch f.out: fdstart.o libboot.a
     81  1.1   mhitch 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     82  1.1   mhitch 	${SIZE} $@
     83  1.1   mhitch 	${NM} -u $@
     84  1.1   mhitch 
     85  1.1   mhitch xxstart.o: ${.CURDIR}/../boot/bbstart.s
     86  1.1   mhitch 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     87  1.1   mhitch 		-o $@ -c $>
     88  1.1   mhitch 
     89  1.1   mhitch fdstart.o: ${.CURDIR}/../boot//bbstart.s
     90  1.1   mhitch 	${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     91  1.1   mhitch 		-o $@ -c $>
     92  1.1   mhitch 
     93  1.1   mhitch libboot.a: ${OBJS}
     94  1.1   mhitch 	${AR} r $@ $> && ${RANLIB} $@
     95  1.1   mhitch 
     96  1.1   mhitch .PHONY:	vers.c
     97  1.1   mhitch vers.c:	${.CURDIR}/../boot/version
     98  1.1   mhitch 	sh ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga"
     99  1.1   mhitch 
    100  1.1   mhitch machine:
    101  1.1   mhitch 	-rm -f $@
    102  1.1   mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
    103  1.1   mhitch 
    104  1.1   mhitch m68k:
    105  1.1   mhitch 	-rm -f $@
    106  1.1   mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
    107  1.1   mhitch 
    108  1.1   mhitch # make sure these are built:
    109  1.1   mhitch 
    110  1.1   mhitch ${COBJS}: ${TXLT}
    111  1.1   mhitch ${FILES}: ${RELOC2BB}
    112  1.2  aymeric 
    113  1.2  aymeric .include "${.CURDIR}/../Makefile.booters"
    114