Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.28
      1  1.28   mhitch #	$NetBSD: Makefile,v 1.28 2002/04/15 08:38:55 mhitch 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.27   mhitch COBJS+=  ufs.o ustarfs.o panic.o vers.o files.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 CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k
     47   1.1       is 
     48  1.18     tron .include <bsd.prog.mk>
     49  1.18     tron 
     50   1.2       is ### special  rules for bootblocks ###
     51   1.1       is 
     52  1.24   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     53  1.24   mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
     54  1.24   mhitch INCPATH += -I${.CURDIR}/../aout2bb -I${DESTDIR}/usr/include
     55  1.10       is 
     56   1.2       is AFLAGS += -m68030 -l
     57  1.10       is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
     58   1.1       is 
     59  1.14   chopps COPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks  -Wa,-l -m68060 -Wa,-m68030
     60  1.18     tron CFLAGS= ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     61   1.1       is 
     62   1.2       is .c.o:
     63  1.18     tron 	${CC} ${CFLAGS} -S $< -o $*.s
     64  1.18     tron 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     65   1.2       is 	rm $*.s
     66   1.1       is 
     67  1.18     tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     68   1.1       is 
     69  1.18     tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     70   1.1       is 
     71  1.24   mhitch boot.amiga: x.out
     72  1.27   mhitch 	${RELOC2BB} -S x.out $@ || ${NM} -u x.out
     73   1.2       is 
     74   1.2       is x.out: xxstart.o libboot.a
     75  1.18     tron 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     76  1.22   mhitch 	${SIZE} $@
     77  1.22   mhitch 	${NM} -u $@
     78   1.2       is 
     79   1.2       is xxstart.o: ${.CURDIR}/bbstart.s
     80  1.18     tron 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     81   1.2       is 		-o $@ -c $>
     82   1.2       is 
     83  1.18     tron libboot.a: ${OBJS}
     84  1.18     tron 	${AR} r $@ $> && ${RANLIB} $@
     85   1.2       is 
     86  1.24   mhitch .PHONY:	vers.c
     87  1.24   mhitch vers.c:	${.CURDIR}/version
     88  1.24   mhitch 	sh ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga"
     89  1.24   mhitch 
     90  1.24   mhitch machine:
     91  1.24   mhitch 	-rm -f $@
     92  1.24   mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
     93  1.24   mhitch 
     94  1.24   mhitch m68k:
     95  1.24   mhitch 	-rm -f $@
     96  1.24   mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
     97  1.24   mhitch 
     98  1.10       is # make sure these are built:
     99   1.2       is 
    100  1.10       is ${COBJS}: ${TXLT}
    101  1.24   mhitch ${FILES}: ${RELOC2BB}
    102  1.26  aymeric 
    103  1.26  aymeric .include "${.CURDIR}/../Makefile.booters"
    104