added -y/--side-by-side option
[dfdiff.git] / sys / boot / powerpc / loader / Makefile
blob29f268c447d8bd3fd19e5e07e74e4f8943ccf4c5
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 $
4 BASE= loader
5 PROG= ${BASE}
6 NOMAN=
7 STRIP=
8 NEWVERSWHAT= "bootstrap loader" OpenFirmware/PowerPC
9 BINDIR?= /boot
10 INSTALLFLAGS= -b
12 LOADER_DISK_SUPPORT?= yes
13 LOADER_NET_SUPPORT?= yes
15 CFLAGS+= -ffreestanding
16 # load address
17 RELOC?= 0x6c0000
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
29 .endif
30 .if defined(LOADER_NET_SUPPORT)
31 CFLAGS+= -DLOADER_NET_SUPPORT
32 .endif
34 ###.if !defined(NOFORTH)
35 #### Enable BootForth
36 ###BOOT_FORTH= yes
37 ###CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
38 ###.if exists(${.OBJDIR}/../../ficl/libficl.a)
39 ###LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
40 ###.else
41 ###LIBFICL= ${.CURDIR}/../../ficl/libficl.a
42 ###.endif
43 ###.endif
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})
65 LIBSTAND= -lstand
66 .endif
67 .endif
68 CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
70 # OpenFirmware is expecting ELF components
71 CFLAGS+= -elf
73 # Debug me!
74 CFLAGS+= -g
75 LDFLAGS+= -g
77 vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
78 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
79 ${CC} -c vers.c
81 ${BASE}.help: help.common help.ofw
82 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
84 beforeinstall:
85 .if exists(${.OBJDIR}/loader.help)
86 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
87 ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
88 .else
89 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
90 ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
91 .endif
92 .if !exists(${DESTDIR}/boot/loader.rc)
93 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
94 ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
95 .endif
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}
107 machine:
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 \
116 start.o