Makefile.booters revision 1.14 1 # $NetBSD: Makefile.booters,v 1.14 2005/12/24 22:22:33 tsutsui Exp $
2
3 S?= ${.CURDIR}/../../../..
4 MDEC_DIR?= /usr/mdec
5 RELOC?= 0x3F0000
6 COPTS?= -O2 -Wall -Wno-main -Wmissing-prototypes -Wstrict-prototypes \
7 -ffreestanding
8 DEFS?=
9 STRIPFLAG?=
10
11 NOMAN= # defined
12 NOMAN= # defined
13 NOLINT= # defined
14 NOLINT= # defined
15 NOPIC= # defined
16 NOPROFILE=# defined
17 NOLINT=# defined
18
19 INCPATH=-I${.OBJDIR} -I${.CURDIR} -I${.CURDIR}/../libsa -I${.CURDIR}/../libbug \
20 -I${.CURDIR}/../../include -I${S} -I${S}/lib/libsa
21 CFLAGS= -nostdinc -m68020-60 -Wa,-m68030
22 CPPFLAGS+= -D__daddr_t=int32_t
23 CPPFLAGS+= -D_STANDALONE -DLIBSA_USE_MEMSET -DLIBSA_USE_MEMCPY
24 CPPFLAGS+= ${INCPATH} ${DEFS}
25 BINDIR= ${MDEC_DIR}
26
27 .if exists(${.CURDIR}/version)
28 SRCS+= vers.c
29 CLEANFILES+= vers.c
30
31 vers.c: version
32 ${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${.CURDIR}/version "mvme68k"
33 .endif
34
35 CLEANFILES+= machine m68k
36
37 machine :
38 -rm -f ${.TARGET}
39 ln -s $S/arch/mvme68k/include machine
40
41 m68k :
42 -rm -f ${.TARGET}
43 ln -s $S/arch/m68k/include m68k
44
45 .if defined(LIB)
46
47 lib${LIB}.a:: machine m68k ${OBJS}
48 beforedepend: machine m68k
49
50 .else
51
52 PROGDEPENDS?= ${SRTOBJ} ${BUGCRT} ${OBJS} ${LIBS}
53 PROGLINKOBJS?= ${PROGDEPENDS}
54
55 ${PROG}: machine m68k ${PROGDEPENDS}
56 ${LD} -N -Ttext ${RELOC} -o $@ ${PROGLINKOBJS}
57
58 .include <bsd.own.mk>
59
60 LIB_SA_DIR= ${.CURDIR}/../libsa
61 LIBSA_DIR!= cd ${LIB_SA_DIR} && ${PRINTOBJDIR}
62 LIBSA=${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
69 SRTOBJ?= ${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
75 LIB_BUG_DIR= ${.CURDIR}/../libbug
76 LIBBUG_DIR!= cd ${LIB_BUG_DIR} && ${PRINTOBJDIR}
77 LIBBUG=${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
84 BUGCRT=${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
91 WRTVID_BOOT_DIR= ${.CURDIR}/../wrtvid
92 WRTVID_DIR!= cd ${WRTVID_BOOT_DIR} && ${PRINTOBJDIR}
93 WRTVID=${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