Makefile.booters revision 1.14
1#	$NetBSD: Makefile.booters,v 1.14 2005/12/24 22:22:33 tsutsui Exp $
2
3S?=		${.CURDIR}/../../../..
4MDEC_DIR?=	/usr/mdec
5RELOC?=		0x3F0000
6COPTS?=		-O2 -Wall -Wno-main -Wmissing-prototypes -Wstrict-prototypes \
7		-ffreestanding
8DEFS?= 
9STRIPFLAG?=
10
11NOMAN=  # defined
12NOMAN=	# defined
13NOLINT= # defined
14NOLINT=	# defined
15NOPIC=	# defined
16NOPROFILE=# defined
17NOLINT=# defined
18
19INCPATH=-I${.OBJDIR} -I${.CURDIR} -I${.CURDIR}/../libsa -I${.CURDIR}/../libbug \
20        -I${.CURDIR}/../../include -I${S} -I${S}/lib/libsa
21CFLAGS= -nostdinc -m68020-60 -Wa,-m68030
22CPPFLAGS+= -D__daddr_t=int32_t
23CPPFLAGS+= -D_STANDALONE -DLIBSA_USE_MEMSET -DLIBSA_USE_MEMCPY
24CPPFLAGS+= ${INCPATH} ${DEFS}
25BINDIR= ${MDEC_DIR}
26
27.if exists(${.CURDIR}/version)
28SRCS+= vers.c
29CLEANFILES+= vers.c
30
31vers.c: version
32	${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${.CURDIR}/version "mvme68k"
33.endif
34
35CLEANFILES+= machine m68k
36
37machine :
38	-rm -f ${.TARGET}
39	ln -s $S/arch/mvme68k/include machine
40
41m68k :
42	-rm -f ${.TARGET}
43	ln -s $S/arch/m68k/include m68k
44
45.if defined(LIB)
46
47lib${LIB}.a:: machine m68k ${OBJS}
48beforedepend:	machine m68k
49
50.else
51
52PROGDEPENDS?=	${SRTOBJ} ${BUGCRT} ${OBJS} ${LIBS}
53PROGLINKOBJS?=	${PROGDEPENDS}
54
55${PROG}: machine m68k ${PROGDEPENDS}
56	${LD} -N -Ttext ${RELOC} -o $@ ${PROGLINKOBJS}
57
58.include <bsd.own.mk>
59
60LIB_SA_DIR=	${.CURDIR}/../libsa
61LIBSA_DIR!=	cd ${LIB_SA_DIR} && ${PRINTOBJDIR}
62LIBSA=${LIBSA_DIR}/libsa.a
63
64.PHONY: ${LIBSA}
65${LIBSA}:
66	@echo making sure the libsa is up to date...
67	@cd ${LIB_SA_DIR} && ${MAKE}
68
69SRTOBJ?= ${LIBSA_DIR}/SRT0.o
70.PHONY: ${SRTOBJ}
71${SRTOBJ}:
72	@echo making sure the libsa is up to date...
73	@cd ${LIB_SA_DIR} && ${MAKE} SRT0.o
74
75LIB_BUG_DIR=	${.CURDIR}/../libbug
76LIBBUG_DIR!=	cd ${LIB_BUG_DIR} && ${PRINTOBJDIR}
77LIBBUG=${LIBBUG_DIR}/libbug.a
78
79.PHONY: ${LIBBUG}
80${LIBBUG}:
81	@echo making sure the libbug is up to date...
82	@(cd ${LIB_BUG_DIR}; ${MAKE})
83
84BUGCRT=${LIBBUG_DIR}/bugstart.o
85
86.PHONY: ${BUGCRT}
87$(BUGCRT):
88	@echo making sure the bugcrt is up to date...
89	@(cd ${LIB_BUG_DIR}; ${MAKE} bugstart.o)
90
91WRTVID_BOOT_DIR=  ${.CURDIR}/../wrtvid
92WRTVID_DIR!=	cd ${WRTVID_BOOT_DIR} && ${PRINTOBJDIR}
93WRTVID=${WRTVID_DIR}/wrtvid
94
95.PHONY: ${WRTVID}
96${WRTVID}:
97	@echo making sure the wrtvid is up to date...
98	@(cd ${WRTVID_BOOT_DIR}; ${MAKE} dependall)
99
100.endif
101