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