Makefile.booters revision 1.16 1 # $NetBSD: Makefile.booters,v 1.16 2009/01/12 07:23:59 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 # XXX SHOULD NOT NEED TO DEFINE THESE!
28 LIBCRT0=
29 LIBC=
30 LIBCRTBEGIN=
31 LIBCRTEND=
32
33 .if exists(${.CURDIR}/version)
34 SRCS+= vers.c
35 CLEANFILES+= vers.c
36
37 vers.c: version
38 ${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${.CURDIR}/version "mvme68k"
39 .endif
40
41 CLEANFILES+= machine m68k
42
43 .if !make(obj) && !make(clean) && !make(cleandir)
44 .NOPATH: machine m68k
45 .BEGIN: machine m68k
46
47 machine :
48 -rm -f ${.TARGET}
49 ln -s $S/arch/mvme68k/include machine
50
51 m68k :
52 -rm -f ${.TARGET}
53 ln -s $S/arch/m68k/include m68k
54 .endif
55
56 .if defined(LIB)
57
58 lib${LIB}.a:: machine m68k ${OBJS}
59 beforedepend: machine m68k
60
61 .else
62
63 PROGDEPENDS?= ${SRTOBJ} ${BUGCRT} ${OBJS} ${LIBS}
64 PROGLINKOBJS?= ${PROGDEPENDS}
65
66 ${PROG}: machine m68k ${PROGDEPENDS}
67 ${LD} -N -Ttext ${RELOC} -o $@ ${PROGLINKOBJS}
68
69 .include <bsd.own.mk>
70
71 LIB_SA_DIR= ${.CURDIR}/../libsa
72 LIBSA_DIR!= cd ${LIB_SA_DIR} && ${PRINTOBJDIR}
73 LIBSA=${LIBSA_DIR}/libsa.a
74
75 .PHONY: ${LIBSA}
76 ${LIBSA}:
77 @echo making sure the libsa is up to date...
78 @cd ${LIB_SA_DIR} && ${MAKE}
79
80 SRTOBJ?= ${LIBSA_DIR}/SRT0.o
81 .PHONY: ${SRTOBJ}
82 ${SRTOBJ}:
83 @echo making sure the libsa is up to date...
84 @cd ${LIB_SA_DIR} && ${MAKE} SRT0.o
85
86 LIB_BUG_DIR= ${.CURDIR}/../libbug
87 LIBBUG_DIR!= cd ${LIB_BUG_DIR} && ${PRINTOBJDIR}
88 LIBBUG=${LIBBUG_DIR}/libbug.a
89
90 .PHONY: ${LIBBUG}
91 ${LIBBUG}:
92 @echo making sure the libbug is up to date...
93 @(cd ${LIB_BUG_DIR}; ${MAKE})
94
95 BUGCRT=${LIBBUG_DIR}/bugstart.o
96
97 .PHONY: ${BUGCRT}
98 $(BUGCRT):
99 @echo making sure the bugcrt is up to date...
100 @(cd ${LIB_BUG_DIR}; ${MAKE} bugstart.o)
101
102 WRTVID_BOOT_DIR= ${.CURDIR}/../wrtvid
103 WRTVID_DIR!= cd ${WRTVID_BOOT_DIR} && ${PRINTOBJDIR}
104 WRTVID=${WRTVID_DIR}/wrtvid
105
106 .PHONY: ${WRTVID}
107 ${WRTVID}:
108 @echo making sure the wrtvid is up to date...
109 @(cd ${WRTVID_BOOT_DIR}; ${MAKE} dependall)
110
111 .endif
112