Home | History | Annotate | Line # | Download | only in bootxx_ffs
Makefile revision 1.22
      1  1.22   martin #	$NetBSD: Makefile,v 1.22 2014/04/29 08:11:46 martin 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.20     matt realall: ${FILES}
     43   1.1   mhitch 
     44  1.20     matt CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c
     45   1.1   mhitch 
     46   1.1   mhitch .include <bsd.prog.mk>
     47  1.20     matt .include <bsd.klinks.mk>
     48   1.1   mhitch 
     49   1.1   mhitch ### special  rules for bootblocks ###
     50   1.1   mhitch 
     51   1.1   mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
     52   1.1   mhitch INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
     53  1.14      mrg INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
     54   1.1   mhitch 
     55   1.1   mhitch AFLAGS += -m68030 -l
     56  1.22   martin CAFLAGS += -Wa,-l -Wa,-march=68030 -Wa,-mcpu=68030 ${INCPATH} -D_PRIMARY_BOOT
     57   1.1   mhitch 
     58  1.19    joerg COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
     59  1.21  mlelstv COPTIM+= -Wa,-l -m68060 -Wa,-mcpu=68030 -fno-unwind-tables
     60   1.4  thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     61   1.1   mhitch 
     62   1.8    lukem NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh
     63   1.1   mhitch DEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     64   1.5   mhitch 
     65   1.5   mhitch # Use small daddr_t to avoid code bloat
     66   1.5   mhitch DEFS+=	-D__daddr_t=int32_t
     67   1.1   mhitch 
     68   1.1   mhitch .c.o:
     69  1.20     matt 	${_MKTARGET_COMPILE}
     70   1.1   mhitch 	${CC} ${CFLAGS} -S $< -o $*.s
     71   1.1   mhitch 	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
     72   1.1   mhitch 	rm $*.s
     73   1.1   mhitch 
     74  1.20     matt .s.o:
     75  1.20     matt 	${_MKTARGET_COMPILE}
     76  1.20     matt 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     77  1.20     matt 
     78  1.20     matt .S.o:
     79  1.20     matt 	${_MKTARGET_COMPILE}
     80  1.20     matt 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
     81   1.1   mhitch 
     82   1.1   mhitch bootxx_ffs: x.out
     83  1.20     matt 	${_MKTARGET_CREATE}
     84  1.17      mrg 	${RELOC2BB} x.out $@ || (${NM} -u x.out && false)
     85   1.1   mhitch 
     86   1.1   mhitch bootxx_fd: f.out
     87  1.20     matt 	${_MKTARGET_CREATE}
     88  1.17      mrg 	${RELOC2BB} -F f.out $@ || (${NM} -u f.out && false)
     89   1.1   mhitch 
     90   1.1   mhitch x.out: xxstart.o libboot.a
     91  1.20     matt 	${_MKTARGET_LINK}
     92  1.20     matt 	${LD} ${LDFLAGS} -r -dc -e start -o $@ $>
     93   1.1   mhitch 	${SIZE} $@
     94   1.1   mhitch 	${NM} -u $@
     95   1.1   mhitch 
     96   1.1   mhitch f.out: fdstart.o libboot.a
     97  1.20     matt 	${_MKTARGET_LINK}
     98  1.20     matt 	${LD} ${LDFLAGS} -r -dc -e start -o $@ $>
     99   1.1   mhitch 	${SIZE} $@
    100   1.1   mhitch 	${NM} -u $@
    101   1.1   mhitch 
    102   1.1   mhitch xxstart.o: ${.CURDIR}/../boot/bbstart.s
    103  1.20     matt 	${_MKTARGET_COMPILE}
    104   1.1   mhitch 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
    105   1.1   mhitch 		-o $@ -c $>
    106   1.1   mhitch 
    107   1.1   mhitch fdstart.o: ${.CURDIR}/../boot//bbstart.s
    108  1.20     matt 	${_MKTARGET_COMPILE}
    109   1.1   mhitch 	${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
    110   1.1   mhitch 		-o $@ -c $>
    111   1.1   mhitch 
    112   1.1   mhitch libboot.a: ${OBJS}
    113  1.20     matt 	${_MKTARGET_BUILD}
    114  1.20     matt 	${AR} crs $@ $> && ${RANLIB} $@
    115   1.1   mhitch 
    116   1.1   mhitch vers.c:	${.CURDIR}/../boot/version
    117  1.20     matt 	${_MKTARGET_CREATE}
    118  1.15    joerg 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N \
    119  1.15    joerg 	    ${.CURDIR}/../boot/version "amiga"
    120   1.1   mhitch 
    121   1.1   mhitch # make sure these are built:
    122   1.1   mhitch 
    123   1.1   mhitch ${COBJS}: ${TXLT}
    124   1.1   mhitch ${FILES}: ${RELOC2BB}
    125   1.2  aymeric 
    126   1.2  aymeric .include "${.CURDIR}/../Makefile.booters"
    127