Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.38
      1  1.38       is #	$NetBSD: Makefile,v 1.38 2006/01/25 13:23:50 is 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.38       is #XX# lines replace similar lines, or are added, in case we want to
      8  1.38       is #XX# compile LIBZ ourselves to save a few bytes (think TXLT)
      9  1.38       is 
     10  1.38       is #XX#DIR_LIBZ =	${DIR_TOP}/../common/dist/zlib
     11  1.38       is 
     12  1.10       is DIR_TOP=	${.CURDIR}/../../../../..
     13  1.10       is DIR_SA = 	${DIR_TOP}/lib/libsa
     14  1.38       is DIR_LIBZ=
     15  1.10       is DIR_KERN=	${DIR_TOP}/lib/libkern
     16  1.10       is DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
     17  1.36       is DIR_LIBC=	${DIR_TOP}/../common/lib/libc
     18   1.1       is 
     19  1.36       is .PATH:  $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD) \
     20  1.36       is 	${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
     21  1.36       is 	${DIR_LIBC}/inet ${DIR_LIBC}/arch/m68k/inet \
     22  1.36       is 	${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \
     23  1.36       is 	${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string
     24   1.1       is 
     25  1.38       is ### find out what to use for libz
     26  1.38       is 
     27  1.38       is S=	${DIR_TOP}	# ????
     28  1.38       is Z_AS= library
     29  1.38       is ZMISCCPPFLAGS=-DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
     30  1.38       is .include "${DIR_TOP}/lib/libz/Makefile.inc"
     31  1.38       is LIBZ= ${ZLIB}
     32  1.38       is 
     33   1.2       is # prefer our assembler versions over assembler, and assembler over C:
     34   1.1       is 
     35   1.2       is .SUFFIXES:
     36   1.2       is .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
     37   1.1       is 
     38  1.24   mhitch FILES= boot.amiga
     39  1.13    veego BINDIR=/usr/mdec
     40   1.1       is 
     41  1.15       is COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
     42  1.19       is COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
     43  1.27   mhitch COBJS+=  ufs.o ustarfs.o panic.o vers.o files.o
     44  1.37       is COBJS+=  divdi3.o moddi3.o qdivrem.o
     45   1.1       is 
     46  1.23   mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
     47  1.38       is SOBJS += strlen.o memcmp.o memset.o strerror.o strncmp.o
     48  1.38       is SOBJS += libstubs.o
     49  1.37       is 
     50   1.2       is OBJS=	$(SOBJS) $(COBJS)
     51   1.1       is 
     52  1.38       is #XX#DEFS = -D_STANDALONE -DINSECURE -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
     53  1.38       is DEFS = -D_STANDALONE -DINSECURE 
     54  1.24   mhitch DEFS += -D__INTERNAL_LIBSA_CREAD
     55  1.24   mhitch SOBJS += cread.o
     56  1.38       is 
     57  1.38       is #XX#SOBJS += adler32.o crc32.o inflate.o trees.o \
     58  1.38       is #XX#       zutil.o infback.o inftrees.o inffast.o
     59  1.38       is 
     60  1.25  aymeric #DEFS += -DBOOT_ELF32 -DBOOT_AOUT
     61  1.24   mhitch SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o
     62  1.24   mhitch 
     63  1.34    lukem NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh
     64  1.24   mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     65   1.1       is 
     66   1.2       is ### main target: ###
     67   1.1       is 
     68  1.24   mhitch realall: machine m68k ${FILES}
     69  1.24   mhitch 
     70  1.24   mhitch CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k
     71   1.1       is 
     72  1.18     tron .include <bsd.prog.mk>
     73  1.18     tron 
     74   1.2       is ### special  rules for bootblocks ###
     75   1.1       is 
     76  1.24   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     77  1.24   mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
     78  1.24   mhitch INCPATH += -I${.CURDIR}/../aout2bb -I${DESTDIR}/usr/include
     79  1.10       is 
     80   1.2       is AFLAGS += -m68030 -l
     81  1.10       is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
     82   1.1       is 
     83  1.33   mhitch COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks  -Wa,-l -m68060 -Wa,-m68030
     84  1.29  thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     85   1.1       is 
     86   1.2       is .c.o:
     87  1.18     tron 	${CC} ${CFLAGS} -S $< -o $*.s
     88  1.18     tron 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     89   1.2       is 	rm $*.s
     90   1.1       is 
     91  1.18     tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     92   1.1       is 
     93  1.18     tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     94   1.1       is 
     95  1.24   mhitch boot.amiga: x.out
     96  1.27   mhitch 	${RELOC2BB} -S x.out $@ || ${NM} -u x.out
     97   1.2       is 
     98  1.38       is x.out: xxstart.o libboot.a ${LIBZ}
     99  1.18     tron 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
    100  1.22   mhitch 	${SIZE} $@
    101  1.22   mhitch 	${NM} -u $@
    102   1.2       is 
    103   1.2       is xxstart.o: ${.CURDIR}/bbstart.s
    104  1.18     tron 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
    105   1.2       is 		-o $@ -c $>
    106   1.2       is 
    107  1.18     tron libboot.a: ${OBJS}
    108  1.18     tron 	${AR} r $@ $> && ${RANLIB} $@
    109   1.2       is 
    110  1.24   mhitch .PHONY:	vers.c
    111  1.24   mhitch vers.c:	${.CURDIR}/version
    112  1.34    lukem 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga"
    113  1.24   mhitch 
    114  1.24   mhitch machine:
    115  1.24   mhitch 	-rm -f $@
    116  1.24   mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
    117  1.24   mhitch 
    118  1.24   mhitch m68k:
    119  1.24   mhitch 	-rm -f $@
    120  1.24   mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
    121  1.24   mhitch 
    122  1.10       is # make sure these are built:
    123   1.2       is 
    124  1.10       is ${COBJS}: ${TXLT}
    125  1.24   mhitch ${FILES}: ${RELOC2BB}
    126  1.26  aymeric 
    127  1.26  aymeric .include "${.CURDIR}/../Makefile.booters"
    128