Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.26
      1  1.26  aymeric #	$NetBSD: Makefile,v 1.26 2002/01/26 15:03:17 aymeric 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.24   mhitch 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.24   mhitch .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.24   mhitch 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.24   mhitch COBJS+=  ufs.o ustarfs.o panic.o vers.o
     24   1.1       is 
     25  1.23   mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
     26  1.24   mhitch SOBJS += strlen.o strcmp.o memcmp.o strerror.o sprintf.o subr_prf.o
     27  1.24   mhitch 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.24   mhitch DEFS += -D__INTERNAL_LIBSA_CREAD
     33  1.24   mhitch SOBJS += cread.o
     34  1.24   mhitch SOBJS += crc32.o inflate.o adler32.o infblock.o infcodes.o inftrees.o # XXX need libz!!!
     35  1.24   mhitch SOBJS += inffast.o infutil.o
     36  1.25  aymeric #DEFS += -DBOOT_ELF32 -DBOOT_AOUT
     37  1.24   mhitch SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o
     38  1.24   mhitch 
     39  1.24   mhitch NETBSD_VERS!=	sh ${.CURDIR}/../../../../../conf/osrelease.sh
     40  1.24   mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     41   1.1       is 
     42   1.2       is ### main target: ###
     43   1.1       is 
     44  1.24   mhitch realall: machine m68k ${FILES}
     45  1.24   mhitch 
     46  1.24   mhitch # Copy boot.amiga to / as well.
     47  1.24   mhitch afterinstall:
     48  1.24   mhitch 	cp -p ${DESTDIR}${BINDIR}/boot.amiga ${DESTDIR}/
     49  1.24   mhitch 
     50  1.24   mhitch 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.24   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     57  1.24   mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
     58  1.24   mhitch 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.24   mhitch boot.amiga: x.out
     76  1.24   mhitch 	${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.24   mhitch .PHONY:	vers.c
     91  1.24   mhitch vers.c:	${.CURDIR}/version
     92  1.24   mhitch 	sh ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga"
     93  1.24   mhitch 
     94  1.24   mhitch machine:
     95  1.24   mhitch 	-rm -f $@
     96  1.24   mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
     97  1.24   mhitch 
     98  1.24   mhitch m68k:
     99  1.24   mhitch 	-rm -f $@
    100  1.24   mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
    101  1.24   mhitch 
    102  1.10       is # make sure these are built:
    103   1.2       is 
    104  1.10       is ${COBJS}: ${TXLT}
    105  1.24   mhitch ${FILES}: ${RELOC2BB}
    106  1.26  aymeric 
    107  1.26  aymeric .include "${.CURDIR}/../Makefile.booters"
    108