Home | History | Annotate | Line # | Download | only in lcboot
Makefile revision 1.2
      1 #	$NetBSD: Makefile,v 1.2 2003/06/24 12:27:03 igy 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 -mno-half-pic -ffreestanding -mmemcpy
     32 LD_SCRIPT=	lcboot.ldscript
     33 
     34 .if defined(ROMICE) && (${ROMICE} == "yes")
     35 CPPFLAGS+=	-DROMICE
     36 .endif
     37 
     38 .if !make(obj) && !make(clean) && !make(cleandir)
     39 .BEGIN:
     40 	@([ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine)
     41 	@[ -h mips ] || ln -s ${S}/arch/mips/include mips
     42 .NOPATH: machine
     43 .endif
     44 CLEANFILES+= machine mips
     45 
     46 ${OBJS}: machine mips
     47 
     48 ### find out what to use for libkern
     49 .include "${S}/lib/libkern/Makefile.inc"
     50 LIBKERN=	${KERNLIB}
     51 
     52 ### find out what to use for libz
     53 .include "${S}/lib/libz/Makefile.inc"
     54 LIBZ=	${ZLIB}
     55 
     56 ### find out what to use for libsa
     57 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
     58 SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
     59 .include "${S}/lib/libsa/Makefile.inc"
     60 LIBSA=	${SALIB}
     61 
     62 LIBLIST=	${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
     63 
     64 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     65 # and CLEANFILES
     66 .if exists (${VERSIONFILE})
     67 SRCS+=	vers.c
     68 CLEANFILES+=	vers.c
     69 .PHONY: vers.c
     70 vers.c: ${VERSIONFILE}
     71 	sh ${S}/conf/newvers_stand.sh ${.ALLSRC} 'hpcmips' ${NEWVERSWHAT}
     72 .endif
     73 
     74 CLEANFILES+=	${PROG}
     75 ${PROG}: ${OBJS} ${LIBKERN} ${LIBSA} ${LIBZ}
     76 	${LD} -o ${PROG} -T ${LD_SCRIPT} ${OBJS} ${LIBLIST}
     77 
     78 CLEANFILES+=	${SREC}
     79 all: ${SREC}
     80 ${SREC}: ${PROG}
     81 	${OBJCOPY} -S -O srec ${PROG} ${SREC}
     82 
     83 .include <bsd.prog.mk>
     84