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