1 1.38.84.1 skrll # $NetBSD: Makefile,v 1.38.84.1 2009/01/19 13:15:56 skrll 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 .include "${DIR_TOP}/lib/libz/Makefile.inc" 30 1.38 is LIBZ= ${ZLIB} 31 1.38 is 32 1.2 is # prefer our assembler versions over assembler, and assembler over C: 33 1.1 is 34 1.2 is .SUFFIXES: 35 1.2 is .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 36 1.1 is 37 1.24 mhitch FILES= boot.amiga 38 1.13 veego BINDIR=/usr/mdec 39 1.1 is 40 1.15 is COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o 41 1.19 is COBJS+= lseek.o open.o read.o close.o dev.o errno.o 42 1.27 mhitch COBJS+= ufs.o ustarfs.o panic.o vers.o files.o 43 1.37 is COBJS+= divdi3.o moddi3.o qdivrem.o 44 1.1 is 45 1.23 mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o 46 1.38 is SOBJS += strlen.o memcmp.o memset.o strerror.o strncmp.o 47 1.38 is SOBJS += libstubs.o 48 1.37 is 49 1.2 is OBJS= $(SOBJS) $(COBJS) 50 1.1 is 51 1.38 is #XX#DEFS = -D_STANDALONE -DINSECURE -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 52 1.38 is DEFS = -D_STANDALONE -DINSECURE 53 1.24 mhitch DEFS += -D__INTERNAL_LIBSA_CREAD 54 1.24 mhitch SOBJS += cread.o 55 1.38 is 56 1.38 is #XX#SOBJS += adler32.o crc32.o inflate.o trees.o \ 57 1.38 is #XX# zutil.o infback.o inftrees.o inffast.o 58 1.38 is 59 1.25 aymeric #DEFS += -DBOOT_ELF32 -DBOOT_AOUT 60 1.24 mhitch SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o 61 1.24 mhitch 62 1.34 lukem NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh 63 1.24 mhitch DEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 64 1.1 is 65 1.2 is ### main target: ### 66 1.1 is 67 1.24 mhitch realall: machine m68k ${FILES} 68 1.24 mhitch 69 1.24 mhitch CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k 70 1.1 is 71 1.18 tron .include <bsd.prog.mk> 72 1.18 tron 73 1.2 is ### special rules for bootblocks ### 74 1.1 is 75 1.38.84.1 skrll INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa 76 1.38.84.1 skrll INCPATH += -I${DIR_TOP}/../common/dist/zlib 77 1.38.84.1 skrll INCPATH += -I${.CURDIR} 78 1.24 mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR} 79 1.38.84.1 skrll INCPATH += -I${.CURDIR}/../aout2bb 80 1.10 is 81 1.2 is AFLAGS += -m68030 -l 82 1.10 is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} 83 1.1 is 84 1.33 mhitch COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 85 1.38.84.1 skrll CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} 86 1.38.84.1 skrll CFLAGS+= -Werror 87 1.38.84.1 skrll CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 88 1.1 is 89 1.2 is .c.o: 90 1.18 tron ${CC} ${CFLAGS} -S $< -o $*.s 91 1.18 tron ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o 92 1.2 is rm $*.s 93 1.1 is 94 1.18 tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 95 1.1 is 96 1.18 tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 97 1.1 is 98 1.24 mhitch boot.amiga: x.out 99 1.27 mhitch ${RELOC2BB} -S x.out $@ || ${NM} -u x.out 100 1.2 is 101 1.38 is x.out: xxstart.o libboot.a ${LIBZ} 102 1.18 tron ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 103 1.22 mhitch ${SIZE} $@ 104 1.22 mhitch ${NM} -u $@ 105 1.2 is 106 1.2 is xxstart.o: ${.CURDIR}/bbstart.s 107 1.18 tron ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 108 1.2 is -o $@ -c $> 109 1.2 is 110 1.18 tron libboot.a: ${OBJS} 111 1.18 tron ${AR} r $@ $> && ${RANLIB} $@ 112 1.2 is 113 1.24 mhitch .PHONY: vers.c 114 1.24 mhitch vers.c: ${.CURDIR}/version 115 1.34 lukem ${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga" 116 1.24 mhitch 117 1.38.84.1 skrll .if !make(obj) && !make(clean) && !make(cleandir) 118 1.38.84.1 skrll .NOPATH: machine m68k 119 1.38.84.1 skrll .BEGIN: machine m68k 120 1.38.84.1 skrll 121 1.24 mhitch machine: 122 1.24 mhitch -rm -f $@ 123 1.24 mhitch ln -s ${DIR_TOP}/arch/amiga/include $@ 124 1.24 mhitch 125 1.24 mhitch m68k: 126 1.24 mhitch -rm -f $@ 127 1.24 mhitch ln -s ${DIR_TOP}/arch/m68k/include $@ 128 1.38.84.1 skrll .endif 129 1.24 mhitch 130 1.10 is # make sure these are built: 131 1.2 is 132 1.10 is ${COBJS}: ${TXLT} 133 1.24 mhitch ${FILES}: ${RELOC2BB} 134 1.26 aymeric 135 1.26 aymeric .include "${.CURDIR}/../Makefile.booters" 136