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