| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.47 2009/01/12 07:05:22 tsutsui Exp $ | | 1 | # $NetBSD: Makefile,v 1.48 2009/03/15 14:54:24 tsutsui Exp $ |
2 | | | 2 | |
3 | S= ${.CURDIR}/../../../.. | | 3 | S= ${.CURDIR}/../../../.. |
4 | | | 4 | |
5 | PROG= ofwboot | | 5 | PROG= ofwboot |
6 | FILES= ${PROG}.elf ${PROG}.xcf | | 6 | FILES= ${PROG}.elf ${PROG}.xcf |
7 | SRCS= Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c | | 7 | SRCS= Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c |
8 | XCOFFXTRA= Xcoffxtra.c | | 8 | XCOFFXTRA= Xcoffxtra.c |
9 | XCOFFXTRAOBJ= Xcoffxtra.o | | 9 | XCOFFXTRAOBJ= Xcoffxtra.o |
10 | CFLAGS+= -msoft-float -mmultiple -ffreestanding | | 10 | CFLAGS+= -msoft-float -mmultiple -ffreestanding |
11 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith | | 11 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith |
12 | #CPPFLAGS+= -DDEBUG -DNETIF_DEBUG | | 12 | #CPPFLAGS+= -DDEBUG -DNETIF_DEBUG |
13 | CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP | | 13 | CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP |
14 | CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK | | 14 | CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK |
| @@ -38,42 +38,33 @@ TOOL_MACPPCFIXCOFFDIR!= cd ${.CURDIR}/.. | | | @@ -38,42 +38,33 @@ TOOL_MACPPCFIXCOFFDIR!= cd ${.CURDIR}/.. |
38 | TOOL_MACPPCFIXCOFF= ${TOOL_MACPPCFIXCOFFDIR}/fixcoff | | 38 | TOOL_MACPPCFIXCOFF= ${TOOL_MACPPCFIXCOFFDIR}/fixcoff |
39 | .endif | | 39 | .endif |
40 | .endif | | 40 | .endif |
41 | | | 41 | |
42 | NEWVERSWHAT= "OpenFirmware Boot" | | 42 | NEWVERSWHAT= "OpenFirmware Boot" |
43 | | | 43 | |
44 | # For now... | | 44 | # For now... |
45 | #RELOC= 20000 | | 45 | #RELOC= 20000 |
46 | RELOC= E00000 | | 46 | RELOC= E00000 |
47 | | | 47 | |
48 | ENTRY= _start | | 48 | ENTRY= _start |
49 | | | 49 | |
50 | CLEANFILES+= vers.c ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf | | 50 | CLEANFILES+= vers.c ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf |
51 | CLEANFILES+= machine powerpc | | | |
52 | | | 51 | |
53 | CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. | | 52 | CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. |
54 | CPPFLAGS+= -DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE} | | 53 | CPPFLAGS+= -DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE} |
55 | #CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs | | 54 | #CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs |
56 | | | 55 | |
57 | CLEANFILES+= ${XCOFFXTRAOBJ} | | 56 | CLEANFILES+= ${XCOFFXTRAOBJ} |
58 | | | 57 | |
59 | .if !make(obj) && !make(clean) && !make(cleandir) | | | |
60 | .BEGIN: | | | |
61 | @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine | | | |
62 | @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc | | | |
63 | .NOPATH: machine powerpc | | | |
64 | .endif | | | |
65 | CLEANFILES+= machine powerpc | | | |
66 | | | | |
67 | ### find out what to use for libkern | | 58 | ### find out what to use for libkern |
68 | KERN_AS= library | | 59 | KERN_AS= library |
69 | .include "${S}/lib/libkern/Makefile.inc" | | 60 | .include "${S}/lib/libkern/Makefile.inc" |
70 | LIBKERN= ${KERNLIB} | | 61 | LIBKERN= ${KERNLIB} |
71 | | | 62 | |
72 | ### find out what to use for libz | | 63 | ### find out what to use for libz |
73 | Z_AS= library | | 64 | Z_AS= library |
74 | .include "${S}/lib/libz/Makefile.inc" | | 65 | .include "${S}/lib/libz/Makefile.inc" |
75 | LIBZ= ${ZLIB} | | 66 | LIBZ= ${ZLIB} |
76 | | | 67 | |
77 | ### find out what to use for libsa | | 68 | ### find out what to use for libsa |
78 | SA_AS= library | | 69 | SA_AS= library |
79 | SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes | | 70 | SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes |
| @@ -87,26 +78,27 @@ cleanlibdir: | | | @@ -87,26 +78,27 @@ cleanlibdir: |
87 | | | 78 | |
88 | .PHONY: vers.c | | 79 | .PHONY: vers.c |
89 | vers.c: version | | 80 | vers.c: version |
90 | ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT} | | 81 | ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT} |
91 | | | 82 | |
92 | all realall: ${PROG} ${PROG}.xcf ${PROG}.elf | | 83 | all realall: ${PROG} ${PROG}.xcf ${PROG}.elf |
93 | | | 84 | |
94 | ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} | | 85 | ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} |
95 | ${_MKTARGET_LINK} | | 86 | ${_MKTARGET_LINK} |
96 | ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.el1 \ | | 87 | ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.el1 \ |
97 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} | | 88 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} |
98 | ${OBJCOPY} -O binary ${PROG}.el1 ${PROG} | | 89 | ${OBJCOPY} -O binary ${PROG}.el1 ${PROG} |
99 | | | 90 | |
| | | 91 | .include <bsd.klinks.mk> |
100 | .include <bsd.prog.mk> | | 92 | .include <bsd.prog.mk> |
101 | | | 93 | |
102 | ${PROG}.elf: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} | | 94 | ${PROG}.elf: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} |
103 | ${_MKTARGET_LINK} | | 95 | ${_MKTARGET_LINK} |
104 | ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \ | | 96 | ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \ |
105 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} | | 97 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} |
106 | | | 98 | |
107 | ${PROG}.xcf: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} | | 99 | ${PROG}.xcf: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} |
108 | ${_MKTARGET_LINK} | | 100 | ${_MKTARGET_LINK} |
109 | ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \ | | 101 | ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \ |
110 | -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \ | | 102 | -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \ |
111 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} | | 103 | ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} |
112 | ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \ | | 104 | ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \ |