Home | History | Annotate | Line # | Download | only in lcboot
Makefile revision 1.3
      1 #	$NetBSD: Makefile,v 1.3 2003/07/26 18:33:51 mrg Exp $
      2 .include <bsd.own.mk>
      3 
      4 ROMICE?=	no
      5 
      6 S=	${.CURDIR}/../../../../
      7 
      8 PROG=	lcboot.out
      9 SREC=	lcboot.srec
     10 MKMAN=	no
     11 WARNS=	1
     12 SRCS=	start.S main.c com.c conf.c dev_flash.c devopen.c i28f128.c
     13 
     14 CPPFLAGS+=	-DDEBUG
     15 
     16 STARTOBJS=
     17 
     18 NEWVERSWHAT=    "L-Card+ Boot"
     19 VERSIONFILE=    ${S}/arch/hpcmips/stand/lcboot/version
     20 
     21 
     22 # Make sure we override any optimization options specified by the user.
     23 #COPTS=  -Os
     24 COPTS=
     25 DBG=
     26 
     27 AFLAGS+=	-D_LOCORE -D_KERNEL
     28 AFLAGS+=	-x assembler-with-cpp -traditional-cpp -mips2 -mno-abicalls
     29 INCLUDES=	-I${.OBJDIR} -I${S} -I${S}/arch
     30 CPPFLAGS+=	${INCLUDES} -nostdinc -D_STANDALONE -DHEAP_LIMIT=0x8002ffff
     31 CFLAGS+=	-mips2 -EL -mno-abicalls -ffreestanding -mmemcpy
     32 .if ${USE_TOOLS_TOOLCHAIN} == "yes"
     33 CFLAGS+=	-mno-half-pic
     34 .endif
     35 LD_SCRIPT=	lcboot.ldscript
     36 
     37 .if defined(ROMICE) && (${ROMICE} == "yes")
     38 CPPFLAGS+=	-DROMICE
     39 .endif
     40 
     41 .if !make(obj) && !make(clean) && !make(cleandir)
     42 .BEGIN:
     43 	@([ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine)
     44 	@[ -h mips ] || ln -s ${S}/arch/mips/include mips
     45 .NOPATH: machine
     46 .endif
     47 CLEANFILES+= machine mips
     48 
     49 ${OBJS}: machine mips
     50 
     51 ### find out what to use for libkern
     52 .include "${S}/lib/libkern/Makefile.inc"
     53 LIBKERN=	${KERNLIB}
     54 
     55 ### find out what to use for libz
     56 .include "${S}/lib/libz/Makefile.inc"
     57 LIBZ=	${ZLIB}
     58 
     59 ### find out what to use for libsa
     60 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
     61 SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
     62 .include "${S}/lib/libsa/Makefile.inc"
     63 LIBSA=	${SALIB}
     64 
     65 LIBLIST=	${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
     66 
     67 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     68 # and CLEANFILES
     69 .if exists (${VERSIONFILE})
     70 SRCS+=	vers.c
     71 CLEANFILES+=	vers.c
     72 .PHONY: vers.c
     73 vers.c: ${VERSIONFILE}
     74 	sh ${S}/conf/newvers_stand.sh ${.ALLSRC} 'hpcmips' ${NEWVERSWHAT}
     75 .endif
     76 
     77 CLEANFILES+=	${PROG}
     78 ${PROG}: ${OBJS} ${LIBKERN} ${LIBSA} ${LIBZ}
     79 	${LD} -o ${PROG} -T ${LD_SCRIPT} ${OBJS} ${LIBLIST}
     80 
     81 CLEANFILES+=	${SREC}
     82 all: ${SREC}
     83 ${SREC}: ${PROG}
     84 	${OBJCOPY} -S -O srec ${PROG} ${SREC}
     85 
     86 .include <bsd.prog.mk>
     87