1 # $FreeBSD: src/sys/boot/powerpc/loader/Makefile,v 1.11 2003/08/16 02:48:20 obrien Exp $
2 # $DragonFly: src/sys/boot/powerpc/loader/Makefile,v 1.2 2005/07/07 11:49:57 corecode Exp $
8 NEWVERSWHAT
= "bootstrap loader" OpenFirmware
/PowerPC
12 LOADER_DISK_SUPPORT?
= yes
13 LOADER_NET_SUPPORT?
= yes
15 CFLAGS
+= -ffreestanding
18 CFLAGS
+= -DRELOC
=${RELOC}
20 # architecture-specific loader code
21 SRCS
= conf.c metadata.c
23 # Pull in common loader code
24 .PATH
: ${.CURDIR
}/..
/..
/ofw
/common
25 .
include <${.CURDIR
}/..
/..
/ofw
/common
/Makefile.inc
>
27 .if defined
(LOADER_DISK_SUPPORT
)
28 CFLAGS
+= -DLOADER_DISK_SUPPORT
30 .if defined
(LOADER_NET_SUPPORT
)
31 CFLAGS
+= -DLOADER_NET_SUPPORT
34 ###.if !defined(NOFORTH)
37 ###CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
38 ###.if exists(${.OBJDIR}/../../ficl/libficl.a)
39 ###LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
41 ###LIBFICL= ${.CURDIR}/../../ficl/libficl.a
45 # Always add MI sources
46 .PATH
: ${.CURDIR
}/..
/..
/common
47 .
include <${.CURDIR
}/..
/..
/common
/Makefile.inc
>
48 CFLAGS
+= -I
${.CURDIR
}/..
/..
/common
49 CFLAGS
+= -I
${.CURDIR
}/..
/..
/..
-I.
51 CLEANFILES
+= vers.c vers.o
${BASE}.list
${BASE}.bin
${BASE}.sym
${BASE}.help
53 LDFLAGS
= -nostdlib
-static
-Ttext
${RELOC}
55 # OpenFirmware standalone support library
56 LIBOFW
= ${.OBJDIR
}/..
/..
/ofw
/libofw
/libofw.a
57 CFLAGS
+= -I
${.CURDIR
}/..
/..
/ofw
/libofw
59 # where to get libstand from
60 #XXX need a better way to do this
61 LIBSTAND
= ${.CURDIR
}/..
/..
/..
/..
/lib
/libstand
/libstand.a
62 .if
!exists
(${LIBSTAND})
63 LIBSTAND
= ${.OBJDIR
}/..
/..
/..
/..
/lib
/libstand
/libstand.a
64 .if
!exists
(${LIBSTAND})
68 CFLAGS
+= -I
${.CURDIR
}/..
/..
/..
/..
/lib
/libstand
/
70 # OpenFirmware is expecting ELF components
77 vers.o
: ${.CURDIR
}/..
/..
/common
/newvers.sh
${.CURDIR
}/version
78 sh
${.CURDIR
}/..
/..
/common
/newvers.sh
${.CURDIR
}/version
${NEWVERSWHAT}
81 ${BASE}.help
: help.common help.ofw
82 cat
${.ALLSRC
} | awk
-f
${.CURDIR
}/..
/..
/common
/merge_help.awk
> ${.TARGET
}
85 .if exists
(${.OBJDIR
}/loader.help
)
86 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
87 ${.OBJDIR
}/${BASE}.help
${DESTDIR}/boot
89 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
90 ${.CURDIR
}/${BASE}.help
${DESTDIR}/boot
92 .if
!exists
(${DESTDIR}/boot
/loader.rc
)
93 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
94 ${.CURDIR
}/..
/..
/forth
/loader.rc
${DESTDIR}/boot
96 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
97 ${.CURDIR
}/..
/..
/forth
/loader
.4th
${DESTDIR}/boot
98 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
99 ${.CURDIR
}/..
/..
/forth
/support
.4th
${DESTDIR}/boot
100 ${INSTALL} -C
-o
${BINOWN} -g
${BINGRP} -m
444 \
101 ${.CURDIR
}/..
/..
/forth
/loader.conf
${DESTDIR}/boot
/defaults
103 ${PROG}: ${OBJS} ${LIBOFW} ${LIBSTAND} ${LIBFICL} start.o vers.o
104 ${LD} ${LDFLAGS} -o
${.TARGET
} start.o
${OBJS} \
105 vers.o
${LIBFICL} ${LIBOFW} ${LIBSTAND}
108 ${LN} -sf
${.CURDIR
}/..
/..
/..
/powerpc
/include machine
110 # Cannot use ${OBJS} above this line
111 .
include <bsd.prog.mk
>
113 beforedepend
${OBJS}: machine
115 CLEANFILES
+= machine setdefs.h setdef0.c setdef1.c setdef0.o setdef1.o \