Makefile revision 1.2
1#	$NetBSD: Makefile,v 1.2 2003/06/24 12:27:03 igy 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 -mno-half-pic -ffreestanding -mmemcpy
32LD_SCRIPT=	lcboot.ldscript
33
34.if defined(ROMICE) && (${ROMICE} == "yes")
35CPPFLAGS+=	-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
44CLEANFILES+= machine mips
45
46${OBJS}: machine mips
47
48### find out what to use for libkern
49.include "${S}/lib/libkern/Makefile.inc"
50LIBKERN=	${KERNLIB}
51
52### find out what to use for libz
53.include "${S}/lib/libz/Makefile.inc"
54LIBZ=	${ZLIB}
55
56### find out what to use for libsa
57SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
58SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
59.include "${S}/lib/libsa/Makefile.inc"
60LIBSA=	${SALIB}
61
62LIBLIST=	${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})
67SRCS+=	vers.c
68CLEANFILES+=	vers.c
69.PHONY: vers.c
70vers.c: ${VERSIONFILE}
71	sh ${S}/conf/newvers_stand.sh ${.ALLSRC} 'hpcmips' ${NEWVERSWHAT}
72.endif
73
74CLEANFILES+=	${PROG}
75${PROG}: ${OBJS} ${LIBKERN} ${LIBSA} ${LIBZ}
76	${LD} -o ${PROG} -T ${LD_SCRIPT} ${OBJS} ${LIBLIST}
77
78CLEANFILES+=	${SREC}
79all: ${SREC}
80${SREC}: ${PROG}
81	${OBJCOPY} -S -O srec ${PROG} ${SREC}
82
83.include <bsd.prog.mk>
84