Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.15.10.1
      1  1.15.10.1    rmind #	$NetBSD: Makefile,v 1.15.10.1 2014/05/18 17:45:07 rmind Exp $
      2        1.1  tsutsui 
      3        1.4  tsutsui WARNS		?= 1
      4        1.1  tsutsui NOMAN		=
      5        1.1  tsutsui 
      6        1.1  tsutsui BINMODE		= 444
      7        1.1  tsutsui 
      8        1.1  tsutsui S		= ${.CURDIR}/../../../..
      9        1.1  tsutsui COMMON		= ${.CURDIR}/../common
     10        1.1  tsutsui 
     11        1.1  tsutsui LIBSADIR	= ${S}/lib/libsa
     12        1.1  tsutsui SYSVBFSDIR	= ${S}/fs/sysvbfs
     13        1.1  tsutsui EWS4800MIPSDIR	= ${.CURDIR}/../../ews4800mips
     14        1.1  tsutsui DEVDIR		= ${.CURDIR}/../../dev
     15        1.1  tsutsui 
     16        1.9  tsutsui # XXX SHOULD NOT NEED TO DEFINE THESE!
     17        1.9  tsutsui LIBCRT0=
     18  1.15.10.1    rmind LIBCRTI=
     19        1.9  tsutsui LIBC=
     20        1.9  tsutsui LIBCRTBEGIN=
     21        1.9  tsutsui LIBCRTEND=
     22        1.9  tsutsui 
     23        1.1  tsutsui .PATH:		${COMMON} ${LIBSADIR} ${SYSVBFSDIR}	\
     24        1.1  tsutsui 		${EWS4800MIPSDIR} ${SBDDIR} ${DEVDIR}
     25        1.1  tsutsui 
     26        1.1  tsutsui COFFHDRFIX	= ${.OBJDIR}/coffhdrfix
     27        1.1  tsutsui 
     28        1.1  tsutsui PROG		= boot
     29        1.1  tsutsui BOOT_KERNEL	= boot_kernel
     30        1.3  tsutsui FILES		+= ${PROG}.coff ${BOOT_KERNEL}.gz # XXX hack to install these
     31        1.1  tsutsui SRCS		= start.S boot.c prompt.c delay.c cmd.c loader.c
     32        1.1  tsutsui SRCS		+= bfs_subr.o disk.c diskutil.c
     33        1.1  tsutsui SRCS		+= devopen.c datafs.c bootfs.c ustarfs.c
     34        1.1  tsutsui SRCS		+= lance.c ether_if.c
     35        1.1  tsutsui SRCS		+= device_test.c cop0.c mem.c
     36        1.1  tsutsui SRCS		+= boot_device.c floppy_2d.c floppy_2hd_ibmpc.c
     37        1.1  tsutsui #SRCS		+= floppy_2hc.c
     38        1.1  tsutsui SRCS		+= console.c cons_rom.c cons_fb.c cons_zskbd.c cons_zs.c
     39        1.1  tsutsui BINKERNEL_C	= ${COMMON}/binkernel.c
     40        1.1  tsutsui BINKERNEL_SIZE	= '2 * 1024 * 1024'
     41        1.1  tsutsui BINKERNEL_O	= binkernel.o
     42        1.1  tsutsui BINKERNEL_DUMMY_O= binkernel_dummy.o
     43        1.1  tsutsui 
     44        1.1  tsutsui # ${S}/lib/libsa
     45        1.1  tsutsui SRCS		+= dev_net.c
     46        1.1  tsutsui # ${S}/fs/sysvbfs
     47        1.1  tsutsui SRCS		+= bfs.c
     48        1.1  tsutsui # ../../dev
     49        1.1  tsutsui SRCS		+= ga.c
     50        1.1  tsutsui # ../../ews4800mips
     51        1.1  tsutsui SRCS		+= pdinfo.c vtoc.c
     52        1.1  tsutsui 
     53        1.1  tsutsui .PHONY: vers.c
     54        1.1  tsutsui vers.c: version
     55        1.7    lukem 	${_MKTARGET_CREATE}
     56       1.12    joerg 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE}
     57        1.1  tsutsui 
     58        1.1  tsutsui SRCS+=	vers.c
     59        1.1  tsutsui CLEANFILES+= vers.c
     60        1.1  tsutsui 
     61        1.1  tsutsui TEXTADDR	= 0xa0a00000
     62        1.5    lukem LINKFLAGS	= -T ${S}/arch/mips/conf/stand.ldscript -Ttext ${TEXTADDR} \
     63        1.1  tsutsui 		  -e start -N
     64        1.1  tsutsui COFFLDFLAGS	= -T ${COMMON}/coffboot.ldscript -N
     65        1.1  tsutsui 
     66        1.1  tsutsui MIPSFLAGS	= -mips1 -G 0 -mno-abicalls
     67        1.1  tsutsui DEBUGFLAGS	= -Wall -Werror
     68        1.1  tsutsui DEBUGFLAGS	+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     69        1.1  tsutsui DEBUGFLAGS	+= -Wno-format-zero-length -Wno-sign-compare
     70        1.1  tsutsui OPTFLAGS	= -Os -mmemcpy
     71        1.1  tsutsui FLAGS		= ${MIPSFLAGS} ${DEBUGFLAGS} ${OPTFLAGS}
     72        1.1  tsutsui AFLAGS		= -xassembler-with-cpp -D_LOCORE ${FLAGS}
     73        1.1  tsutsui CFLAGS		= ${FLAGS} -ffreestanding
     74        1.1  tsutsui 
     75        1.1  tsutsui CPPFLAGS	+= -D_STANDALONE -DSUPPORT_BOOTP
     76        1.1  tsutsui CPPFLAGS	+= -nostdinc -I${.OBJDIR} -I${.CURDIR} -I${COMMON} -I${S}
     77        1.1  tsutsui CPPFLAGS	+= -D__daddr_t=int32_t
     78        1.2  tsutsui #CPPFLAGS	+= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
     79        1.2  tsutsui #CPPFLAGS	+= -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
     80        1.1  tsutsui 
     81        1.1  tsutsui CLEANFILES	+= ${BINKERNEL_DUMMY_O} ${BINKERNEL_O}
     82        1.3  tsutsui CLEANFILES	+= ${PROG} ${PROG}.elf ${PROG}.coff ${PROG}.tmp ${PROG}.dis
     83        1.1  tsutsui CLEANFILES	+= ${COFFHDRFIX}
     84        1.3  tsutsui CLEANFILES	+= ${BOOT_KERNEL} ${BOOT_KERNEL}.elf ${BOOT_KERNEL}.tmp
     85        1.1  tsutsui CLEANFILES	+= ${BOOT_KERNEL}.gz ${BOOT_KERNEL}.gz.tmp
     86        1.1  tsutsui 
     87        1.1  tsutsui .include "${S}/lib/libkern/Makefile.inc"
     88        1.1  tsutsui LIBKERN=	${KERNLIB}
     89        1.1  tsutsui 
     90        1.1  tsutsui .include "${S}/lib/libz/Makefile.inc"
     91        1.1  tsutsui LIBZ=		${ZLIB}
     92        1.1  tsutsui 
     93       1.15  tsutsui CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
     94       1.15  tsutsui SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_ENABLE_LS_OP=yes
     95        1.1  tsutsui .include "${S}/lib/libsa/Makefile.inc"
     96        1.1  tsutsui LIBSA=		${SALIB}
     97        1.1  tsutsui 
     98        1.1  tsutsui LIBS		= ${LIBSA} ${LIBZ} ${LIBKERN}
     99        1.1  tsutsui 
    100        1.1  tsutsui # fixup GNU binutils file offset error.
    101        1.1  tsutsui coffhdrfix:	${COMMON}/coffhdrfix.c
    102        1.1  tsutsui 	${HOST_CC} -o ${COFFHDRFIX} ${COMMON}/coffhdrfix.c
    103        1.1  tsutsui 
    104  1.15.10.1    rmind cleandir distclean: .WAIT cleanlibdir
    105        1.1  tsutsui 
    106        1.1  tsutsui cleanlibdir:
    107        1.1  tsutsui 	-rm -rf lib
    108        1.1  tsutsui 
    109        1.1  tsutsui ${BINKERNEL_DUMMY_O}: ${BINKERNEL_C}
    110        1.6    lukem 	${_MKTARGET_COMPILE}
    111        1.1  tsutsui 	${COMPILE.c} -DKERNEL_SIZE=0 ${BINKERNEL_C} -o ${.TARGET}
    112        1.1  tsutsui 
    113        1.1  tsutsui ${BINKERNEL_O}: ${BINKERNEL_C}
    114        1.6    lukem 	${_MKTARGET_COMPILE}
    115        1.2  tsutsui 	${COMPILE.c} -DKERNEL_SIZE=${BINKERNEL_SIZE} ${BINKERNEL_C} \
    116        1.2  tsutsui 	    -o ${.TARGET}
    117        1.1  tsutsui 
    118        1.3  tsutsui all realall: ${PROG}.coff ${BOOT_KERNEL}.gz
    119        1.1  tsutsui 
    120        1.1  tsutsui ${PROG}: ${BINKERNEL_DUMMY_O} ${OBJS} ${LIBS}
    121        1.6    lukem 	${_MKTARGET_LINK}
    122        1.5    lukem 	${LD} ${LINKFLAGS} -S -o ${PROG}.elf ${OBJS} ${LIBS} \
    123        1.5    lukem 	    ${BINKERNEL_DUMMY_O}
    124        1.1  tsutsui 	${OBJDUMP} -h ${PROG}.elf
    125        1.3  tsutsui #	${OBJDUMP} -m mips:4000 -d ${PROG}.elf > ${PROG}.dis
    126        1.1  tsutsui 	mv ${PROG}.elf ${PROG}
    127        1.1  tsutsui 	ls -al ${PROG}
    128        1.1  tsutsui 
    129        1.9  tsutsui .include <bsd.klinks.mk>
    130        1.2  tsutsui .include <bsd.prog.mk>
    131        1.2  tsutsui 
    132        1.3  tsutsui ${PROG}.coff:	${PROG}
    133        1.6    lukem 	${_MKTARGET_CREATE}
    134        1.3  tsutsui 	${ELF2ECOFF} ${PROG} ${.TARGET}.tmp
    135        1.3  tsutsui 	mv ${.TARGET}.tmp ${.TARGET}
    136        1.3  tsutsui 	
    137        1.3  tsutsui ${BOOT_KERNEL}.gz: ${BINKERNEL_O} ${OBJS} ${LIBS}
    138        1.6    lukem 	${_MKTARGET_LINK}
    139        1.5    lukem 	${LD} ${LINKFLAGS} -o ${BOOT_KERNEL}.elf ${OBJS} ${LIBS} \
    140        1.1  tsutsui 	    ${BINKERNEL_O}
    141        1.3  tsutsui 	mv ${BOOT_KERNEL}.elf ${BOOT_KERNEL}
    142        1.3  tsutsui 	${OBJDUMP} -h ${BOOT_KERNEL}
    143  1.15.10.1    rmind 	${TOOL_GZIP} -9nc ${BOOT_KERNEL} > ${.TARGET}.tmp
    144        1.1  tsutsui 	mv ${.TARGET}.tmp ${.TARGET}
    145        1.3  tsutsui 	ls -al ${.TARGET}
    146       1.13      mrg 
    147       1.13      mrg COPTS.ustarfs.c+=	-fno-strict-aliasing
    148