Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.22.8.1
      1  1.22.8.1  nathanw #	$NetBSD: Makefile,v 1.22.8.1 2002/01/08 00:23:00 nathanw Exp $
      2       1.1       is 
      3       1.2       is ### what we need:
      4       1.1       is 
      5      1.10       is DIR_TOP=	${.CURDIR}/../../../../..
      6      1.10       is DIR_SA = 	${DIR_TOP}/lib/libsa
      7  1.22.8.1  nathanw DIR_LIBZ =	${DIR_TOP}/lib/libz
      8      1.10       is DIR_KERN=	${DIR_TOP}/lib/libkern
      9      1.10       is DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
     10       1.1       is 
     11  1.22.8.1  nathanw .PATH:  $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD)
     12       1.1       is 
     13       1.2       is # prefer our assembler versions over assembler, and assembler over C:
     14       1.1       is 
     15       1.2       is .SUFFIXES:
     16       1.2       is .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
     17       1.1       is 
     18  1.22.8.1  nathanw FILES= boot.amiga
     19      1.13    veego BINDIR=/usr/mdec
     20       1.1       is 
     21      1.15       is COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
     22      1.19       is COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
     23  1.22.8.1  nathanw COBJS+=  ufs.o ustarfs.o panic.o vers.o
     24       1.1       is 
     25  1.22.8.1  nathanw SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
     26  1.22.8.1  nathanw SOBJS += strlen.o strcmp.o memcmp.o strerror.o sprintf.o subr_prf.o
     27  1.22.8.1  nathanw SOBJS += libstubs.o memset.o strncmp.o
     28       1.1       is 
     29       1.2       is OBJS=	$(SOBJS) $(COBJS)
     30       1.1       is 
     31      1.17       is DEFS = -D_STANDALONE -DINSECURE
     32  1.22.8.1  nathanw DEFS += -D__INTERNAL_LIBSA_CREAD
     33  1.22.8.1  nathanw SOBJS += cread.o
     34  1.22.8.1  nathanw SOBJS += crc32.o inflate.o adler32.o infblock.o infcodes.o inftrees.o # XXX need libz!!!
     35  1.22.8.1  nathanw SOBJS += inffast.o infutil.o
     36  1.22.8.1  nathanw #DEFS += -DBOOT_ELF -DBOOT_AOUT
     37  1.22.8.1  nathanw SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o
     38  1.22.8.1  nathanw 
     39  1.22.8.1  nathanw NETBSD_VERS!=	sh ${.CURDIR}/../../../../../conf/osrelease.sh
     40  1.22.8.1  nathanw DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     41       1.1       is 
     42       1.2       is ### main target: ###
     43       1.1       is 
     44  1.22.8.1  nathanw realall: machine m68k ${FILES}
     45  1.22.8.1  nathanw 
     46  1.22.8.1  nathanw # Copy boot.amiga to / as well.
     47  1.22.8.1  nathanw afterinstall:
     48  1.22.8.1  nathanw 	cp -p ${DESTDIR}${BINDIR}/boot.amiga ${DESTDIR}/
     49  1.22.8.1  nathanw 
     50  1.22.8.1  nathanw CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k
     51       1.1       is 
     52      1.18     tron .include <bsd.prog.mk>
     53      1.18     tron 
     54       1.2       is ### special  rules for bootblocks ###
     55       1.1       is 
     56  1.22.8.1  nathanw INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     57  1.22.8.1  nathanw INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
     58  1.22.8.1  nathanw INCPATH += -I${.CURDIR}/../aout2bb -I${DESTDIR}/usr/include
     59      1.10       is 
     60       1.2       is AFLAGS += -m68030 -l
     61      1.10       is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
     62       1.1       is 
     63      1.14   chopps COPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks  -Wa,-l -m68060 -Wa,-m68030
     64      1.18     tron CFLAGS= ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     65       1.1       is 
     66       1.2       is .c.o:
     67      1.18     tron 	${CC} ${CFLAGS} -S $< -o $*.s
     68      1.18     tron 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     69       1.2       is 	rm $*.s
     70       1.1       is 
     71      1.18     tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     72       1.1       is 
     73      1.18     tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     74       1.1       is 
     75  1.22.8.1  nathanw boot.amiga: x.out
     76  1.22.8.1  nathanw 	${RELOC2BB} -S 32768 x.out $@ || ${NM} -u x.out
     77       1.2       is 
     78       1.2       is x.out: xxstart.o libboot.a
     79      1.18     tron 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     80      1.22   mhitch 	${SIZE} $@
     81      1.22   mhitch 	${NM} -u $@
     82       1.2       is 
     83       1.2       is xxstart.o: ${.CURDIR}/bbstart.s
     84      1.18     tron 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     85       1.2       is 		-o $@ -c $>
     86       1.2       is 
     87      1.18     tron libboot.a: ${OBJS}
     88      1.18     tron 	${AR} r $@ $> && ${RANLIB} $@
     89       1.2       is 
     90  1.22.8.1  nathanw .PHONY:	vers.c
     91  1.22.8.1  nathanw vers.c:	${.CURDIR}/version
     92  1.22.8.1  nathanw 	sh ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga"
     93  1.22.8.1  nathanw 
     94  1.22.8.1  nathanw machine:
     95  1.22.8.1  nathanw 	-rm -f $@
     96  1.22.8.1  nathanw 	ln -s ${DIR_TOP}/arch/amiga/include $@
     97  1.22.8.1  nathanw 
     98  1.22.8.1  nathanw m68k:
     99  1.22.8.1  nathanw 	-rm -f $@
    100  1.22.8.1  nathanw 	ln -s ${DIR_TOP}/arch/m68k/include $@
    101  1.22.8.1  nathanw 
    102      1.10       is # make sure these are built:
    103       1.2       is 
    104      1.10       is ${COBJS}: ${TXLT}
    105  1.22.8.1  nathanw ${FILES}: ${RELOC2BB}
    106