Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.47.24.1
      1  1.47.24.1  riastrad #	$NetBSD: Makefile,v 1.47.24.1 2013/07/23 21:07:33 riastradh Exp $
      2       1.34     lukem 
      3       1.44     joerg .include <bsd.own.mk>
      4       1.34     lukem .include <bsd.sys.mk>		# for HOST_SH
      5        1.1        is 
      6        1.2        is ### what we need:
      7        1.1        is 
      8       1.38        is #XX# lines replace similar lines, or are added, in case we want to
      9       1.38        is #XX# compile LIBZ ourselves to save a few bytes (think TXLT)
     10       1.38        is 
     11       1.38        is #XX#DIR_LIBZ =	${DIR_TOP}/../common/dist/zlib
     12       1.38        is 
     13       1.10        is DIR_TOP=	${.CURDIR}/../../../../..
     14       1.10        is DIR_SA = 	${DIR_TOP}/lib/libsa
     15       1.38        is DIR_LIBZ=
     16       1.10        is DIR_KERN=	${DIR_TOP}/lib/libkern
     17       1.10        is DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
     18       1.36        is DIR_LIBC=	${DIR_TOP}/../common/lib/libc
     19        1.1        is 
     20       1.36        is .PATH:  $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD) \
     21       1.36        is 	${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
     22       1.36        is 	${DIR_LIBC}/inet ${DIR_LIBC}/arch/m68k/inet \
     23       1.36        is 	${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \
     24       1.36        is 	${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string
     25        1.1        is 
     26       1.38        is ### find out what to use for libz
     27       1.38        is 
     28       1.38        is S=	${DIR_TOP}	# ????
     29       1.38        is Z_AS= library
     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.42       mrg .SUFFIXES: .out .o .po .pico .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.41      elad #XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
     53       1.41      elad DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
     54       1.24    mhitch DEFS += -D__INTERNAL_LIBSA_CREAD
     55       1.40   mlelstv #DEFS += -DSERCONSOLE
     56       1.24    mhitch SOBJS += cread.o
     57       1.38        is 
     58       1.38        is #XX#SOBJS += adler32.o crc32.o inflate.o trees.o \
     59       1.38        is #XX#       zutil.o infback.o inftrees.o inffast.o
     60       1.38        is 
     61       1.25   aymeric #DEFS += -DBOOT_ELF32 -DBOOT_AOUT
     62       1.24    mhitch SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o
     63       1.24    mhitch 
     64       1.34     lukem NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh
     65       1.24    mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     66        1.1        is 
     67        1.2        is ### main target: ###
     68        1.1        is 
     69       1.24    mhitch realall: machine m68k ${FILES}
     70       1.24    mhitch 
     71       1.24    mhitch CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k
     72        1.1        is 
     73       1.18      tron .include <bsd.prog.mk>
     74       1.18      tron 
     75        1.2        is ### special  rules for bootblocks ###
     76        1.1        is 
     77       1.39   tsutsui INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa
     78       1.39   tsutsui INCPATH += -I${DIR_TOP}/../common/dist/zlib
     79       1.39   tsutsui INCPATH += -I${.CURDIR}
     80       1.24    mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
     81       1.43       mrg INCPATH += -I${.CURDIR}/../elf2bb
     82       1.10        is 
     83        1.2        is AFLAGS += -m68030 -l
     84       1.10        is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
     85        1.1        is 
     86  1.47.24.1  riastrad COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
     87  1.47.24.1  riastrad COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables
     88       1.39   tsutsui CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS}
     89       1.39   tsutsui CFLAGS+= -Werror
     90       1.39   tsutsui CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     91        1.1        is 
     92       1.47       chs # XXX work around a gcc 4.5 bug
     93       1.47       chs COPTS.cread.c = -O1
     94       1.47       chs 
     95        1.2        is .c.o:
     96       1.47       chs 	${CC} ${CFLAGS} ${COPTS.${.IMPSRC:T}} -S $< -o $*.s
     97       1.43       mrg 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $@
     98        1.2        is 	rm $*.s
     99        1.1        is 
    100       1.18      tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
    101        1.1        is 
    102       1.18      tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
    103        1.1        is 
    104       1.24    mhitch boot.amiga: x.out
    105       1.46       mrg 	${RELOC2BB} -S x.out $@ || (${NM} -u x.out && false)
    106        1.2        is 
    107       1.38        is x.out: xxstart.o libboot.a ${LIBZ}
    108       1.45       mrg 	${LD} ${LDFLAGS} -r -dc -e start -o $@ $>
    109       1.22    mhitch 	${SIZE} $@
    110       1.22    mhitch 	${NM} -u $@
    111        1.2        is 
    112        1.2        is xxstart.o: ${.CURDIR}/bbstart.s
    113       1.18      tron 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
    114        1.2        is 		-o $@ -c $>
    115        1.2        is 
    116       1.18      tron libboot.a: ${OBJS}
    117       1.18      tron 	${AR} r $@ $> && ${RANLIB} $@
    118        1.2        is 
    119       1.43       mrg vers.o: vers.c
    120       1.24    mhitch vers.c:	${.CURDIR}/version
    121       1.44     joerg 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh \
    122       1.44     joerg 	    ${${MKREPRO} == "yes" :?:-D} -N ${.CURDIR}/version "amiga"
    123       1.24    mhitch 
    124       1.39   tsutsui .if !make(obj) && !make(clean) && !make(cleandir)
    125       1.39   tsutsui .NOPATH: machine m68k
    126       1.39   tsutsui .BEGIN: machine m68k
    127       1.39   tsutsui 
    128       1.24    mhitch machine:
    129       1.24    mhitch 	-rm -f $@
    130       1.24    mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
    131       1.24    mhitch 
    132       1.24    mhitch m68k:
    133       1.24    mhitch 	-rm -f $@
    134       1.24    mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
    135       1.39   tsutsui .endif
    136       1.24    mhitch 
    137       1.10        is # make sure these are built:
    138        1.2        is 
    139       1.10        is ${COBJS}: ${TXLT}
    140       1.24    mhitch ${FILES}: ${RELOC2BB}
    141       1.26   aymeric 
    142       1.26   aymeric .include "${.CURDIR}/../Makefile.booters"
    143