Home | History | Annotate | Line # | Download | only in lcboot
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 2003/05/01 07:02:01 igy Exp $
      2 .include <bsd.own.mk>
      3 
      4 ROMICE?=	yes
      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 dev_lc.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 CPPFLAGS+=	-DLIBSA_SINGLE_FILESYSTEM=lc -DLIBSA_SINGLE_DEVICE=lcdev
     60 .include "${S}/lib/libsa/Makefile.inc"
     61 LIBSA=	${SALIB}
     62 
     63 LIBLIST=	${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBSA}
     64 
     65 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     66 # and CLEANFILES
     67 .if exists (${VERSIONFILE})
     68 SRCS+=	vers.c
     69 CLEANFILES+=	vers.c
     70 .PHONY: vers.c
     71 vers.c: ${VERSIONFILE}
     72 	sh ${S}/conf/newvers_stand.sh ${.ALLSRC} 'hpcmips' ${NEWVERSWHAT}
     73 .endif
     74 
     75 CLEANFILES+=	${PROG}
     76 ${PROG}: ${OBJS} ${LIBKERN} ${LIBSA} ${LIBZ}
     77 	${LD} -o ${PROG} -T ${LD_SCRIPT} ${OBJS} ${LIBLIST}
     78 
     79 CLEANFILES+=	${SREC}
     80 all: ${SREC}
     81 ${SREC}: ${PROG}
     82 	${OBJCOPY} -S -O srec ${PROG} ${SREC}
     83 
     84 .include <bsd.prog.mk>
     85