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