Home | History | Annotate | Line # | Download | only in bootxx_ffs
Makefile revision 1.19
      1  1.19    joerg #	$NetBSD: Makefile,v 1.19 2013/07/18 12:15:15 joerg Exp $
      2   1.1   mhitch 
      3   1.1   mhitch ### what we need:
      4   1.1   mhitch 
      5   1.1   mhitch DIR_TOP=	${.CURDIR}/../../../../..
      6   1.1   mhitch DIR_SA = 	${DIR_TOP}/lib/libsa
      7   1.1   mhitch DIR_KERN=	${DIR_TOP}/lib/libkern
      8   1.1   mhitch DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
      9  1.10       is DIR_LIBC=	${DIR_TOP}/../common/lib/libc
     10  1.10       is 
     11  1.10       is .PATH:  ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) \
     12  1.10       is 	${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
     13  1.10       is 	${DIR_LIBC}/inet ${DIR_LIBC}/arch/m68k/inet \
     14  1.10       is 	${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \
     15  1.10       is 	${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string
     16   1.1   mhitch 
     17   1.1   mhitch 
     18   1.1   mhitch # prefer our assembler versions over assembler, and assembler over C:
     19   1.1   mhitch 
     20   1.1   mhitch .SUFFIXES:
     21  1.13      mrg .SUFFIXES: .out .o .po .pico .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
     22   1.1   mhitch 
     23   1.1   mhitch FILES= bootxx_ffs bootxx_fd
     24   1.1   mhitch BINDIR=/usr/mdec
     25   1.1   mhitch 
     26   1.1   mhitch COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
     27   1.1   mhitch COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
     28   1.3   mhitch COBJS+=  ufs.o ustarfs.o panic.o vers.o files.o
     29   1.1   mhitch 
     30   1.1   mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
     31   1.1   mhitch SOBJS += strlen.o strcmp.o fstat.o
     32   1.6       he SOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o
     33   1.1   mhitch 
     34   1.1   mhitch OBJS=	$(SOBJS) $(COBJS)
     35   1.1   mhitch 
     36  1.12     elad DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -D_PRIMARY_BOOT
     37   1.1   mhitch 
     38   1.1   mhitch .NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o
     39   1.1   mhitch 
     40   1.1   mhitch ### main target: ###
     41   1.1   mhitch 
     42   1.1   mhitch realall: machine m68k ${FILES}
     43   1.1   mhitch 
     44   1.1   mhitch CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k
     45   1.1   mhitch 
     46   1.1   mhitch .include <bsd.prog.mk>
     47   1.1   mhitch 
     48   1.1   mhitch ### special  rules for bootblocks ###
     49   1.1   mhitch 
     50   1.1   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     51   1.1   mhitch INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
     52  1.14      mrg INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
     53   1.1   mhitch 
     54   1.1   mhitch AFLAGS += -m68030 -l
     55   1.1   mhitch CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT
     56   1.1   mhitch 
     57  1.19    joerg COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
     58  1.19    joerg COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables
     59   1.4  thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     60   1.1   mhitch 
     61   1.8    lukem NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh
     62   1.1   mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     63   1.5   mhitch 
     64   1.5   mhitch # Use small daddr_t to avoid code bloat
     65   1.5   mhitch DEFS+=	-D__daddr_t=int32_t
     66   1.1   mhitch 
     67   1.1   mhitch .c.o:
     68   1.1   mhitch 	${CC} ${CFLAGS} -S $< -o $*.s
     69   1.1   mhitch 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     70   1.1   mhitch 	rm $*.s
     71   1.1   mhitch 
     72   1.1   mhitch .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     73   1.1   mhitch 
     74   1.1   mhitch .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     75   1.1   mhitch 
     76   1.1   mhitch bootxx_ffs: x.out
     77  1.17      mrg 	${RELOC2BB} x.out $@ || (${NM} -u x.out && false)
     78   1.1   mhitch 
     79   1.1   mhitch bootxx_fd: f.out
     80  1.17      mrg 	${RELOC2BB} -F f.out $@ || (${NM} -u f.out && false)
     81   1.1   mhitch 
     82   1.1   mhitch x.out: xxstart.o libboot.a
     83   1.1   mhitch 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     84   1.1   mhitch 	${SIZE} $@
     85   1.1   mhitch 	${NM} -u $@
     86   1.1   mhitch 
     87   1.1   mhitch f.out: fdstart.o libboot.a
     88   1.1   mhitch 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
     89   1.1   mhitch 	${SIZE} $@
     90   1.1   mhitch 	${NM} -u $@
     91   1.1   mhitch 
     92   1.1   mhitch xxstart.o: ${.CURDIR}/../boot/bbstart.s
     93   1.1   mhitch 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     94   1.1   mhitch 		-o $@ -c $>
     95   1.1   mhitch 
     96   1.1   mhitch fdstart.o: ${.CURDIR}/../boot//bbstart.s
     97   1.1   mhitch 	${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
     98   1.1   mhitch 		-o $@ -c $>
     99   1.1   mhitch 
    100   1.1   mhitch libboot.a: ${OBJS}
    101   1.1   mhitch 	${AR} r $@ $> && ${RANLIB} $@
    102   1.1   mhitch 
    103   1.1   mhitch vers.c:	${.CURDIR}/../boot/version
    104  1.15    joerg 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N \
    105  1.15    joerg 	    ${.CURDIR}/../boot/version "amiga"
    106   1.1   mhitch 
    107  1.11  tsutsui .if !make(obj) && !make(clean) && !make(cleandir)
    108  1.11  tsutsui .NOPATH: machine m68k
    109  1.11  tsutsui .BEGIN: machine m68k
    110  1.11  tsutsui 
    111   1.1   mhitch machine:
    112   1.1   mhitch 	-rm -f $@
    113   1.1   mhitch 	ln -s ${DIR_TOP}/arch/amiga/include $@
    114   1.1   mhitch 
    115   1.1   mhitch m68k:
    116   1.1   mhitch 	-rm -f $@
    117   1.1   mhitch 	ln -s ${DIR_TOP}/arch/m68k/include $@
    118  1.11  tsutsui .endif
    119   1.1   mhitch 
    120   1.1   mhitch # make sure these are built:
    121   1.1   mhitch 
    122   1.1   mhitch ${COBJS}: ${TXLT}
    123   1.1   mhitch ${FILES}: ${RELOC2BB}
    124   1.2  aymeric 
    125   1.2  aymeric .include "${.CURDIR}/../Makefile.booters"
    126