No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / macppc / stand / ofwboot / Makefile
blobcdc8086f778ad4e749c62ecd8da3c7ff3df1d83b
1 # $NetBSD: Makefile,v 1.48 2009/03/15 14:54:24 tsutsui Exp $
3 S= ${.CURDIR}/../../../..
5 PROG= ofwboot
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
8 XCOFFXTRA= Xcoffxtra.c
9 XCOFFXTRAOBJ= Xcoffxtra.o
10 CFLAGS+= -msoft-float -mmultiple -ffreestanding
11 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
12 #CPPFLAGS+= -DDEBUG -DNETIF_DEBUG
13 CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP
14 CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK
15 DBG= -Os
17 LIBCRT0= # nothing
18 LIBCRTBEGIN= # nothing
19 LIBCRTEND= # nothing
20 LIBC= # nothing
22 .PATH: ${S}/arch/powerpc/powerpc
23 SRCS+= ofwmagic.S
25 .PATH: ${S}/lib/libsa
26 SRCS+= byteorder.c
28 NOMAN= # defined
29 STRIPFLAG=
30 BINMODE= 444
32 .if !defined(FIXCOFF)
33 .include <bsd.own.mk>
35 .if !defined(TOOL_MACPPCFIXCOFF)
36 TOOL_MACPPCFIXCOFFDIR!= cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
37 TOOL_MACPPCFIXCOFF= ${TOOL_MACPPCFIXCOFFDIR}/fixcoff
38 .endif
39 .endif
41 NEWVERSWHAT= "OpenFirmware Boot"
43 # For now...
44 #RELOC= 20000
45 RELOC= E00000
47 ENTRY= _start
49 CLEANFILES+= vers.c ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf
51 CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
52 CPPFLAGS+= -DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE}
53 #CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs
55 CLEANFILES+= ${XCOFFXTRAOBJ}
57 ### find out what to use for libkern
58 KERN_AS= library
59 .include "${S}/lib/libkern/Makefile.inc"
60 LIBKERN= ${KERNLIB}
62 ### find out what to use for libz
63 Z_AS= library
64 .include "${S}/lib/libz/Makefile.inc"
65 LIBZ= ${ZLIB}
67 ### find out what to use for libsa
68 SA_AS= library
69 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
70 .include "${S}/lib/libsa/Makefile.inc"
71 LIBSA= ${SALIB}
73 cleandir distclean: cleanlibdir
75 cleanlibdir:
76 -rm -rf lib
78 .PHONY: vers.c
79 vers.c: version
80 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT}
82 all realall: ${PROG} ${PROG}.xcf ${PROG}.elf
84 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
85 ${_MKTARGET_LINK}
86 ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.el1 \
87 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
88 ${OBJCOPY} -O binary ${PROG}.el1 ${PROG}
90 .include <bsd.klinks.mk>
91 .include <bsd.prog.mk>
93 ${PROG}.elf: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
94 ${_MKTARGET_LINK}
95 ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
96 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
98 ${PROG}.xcf: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN}
99 ${_MKTARGET_LINK}
100 ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
101 -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \
102 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
103 ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
104 ${PROG}.mrg ${PROG}.xcf
105 ${TOOL_MACPPCFIXCOFF} ${PROG}.xcf