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