1 # $NetBSD: Makefile,v 1.21 2007/10/17 19:57:16 garbled Exp $
4 S
= ${CURDIR}/..
/..
/..
/..
7 # Override normal settings
13 SRCS
= srt0.s Locore.c boot.c ofdev.c alloc.c net.c netif_of.c vers.c
14 SRCS
+= bootinfo.c loadfile_machdep.c promlib.c prf.c
15 .PATH
: ${S}/arch
/sparc64
/sparc64
17 # XXX SHOULD NOT NEED TO DEFINE THESE!
23 COPTS
+= -ffreestanding
24 CWARNFLAGS
+= -Wno-main
25 CFLAGS
+= ${COPTS} ${CEXTRAFLAGS}
26 CPPFLAGS
+= -D_STANDALONE
-DSUN4U
27 CPPFLAGS
+= -DBOOT_ELF32
-DBOOT_ELF64
-DBOOT_AOUT
29 CPPFLAGS
+= -DSUPPORT_DHCP
30 #CPPFLAGS+= -DNETIF_DEBUG
33 LINKS
+= ${BINDIR}/ofwboot
${BINDIR}/ofwboot.net
39 NEWVERSWHAT
= "OpenFirmware Boot"
42 # Elf64 defaults to 1MB
44 # We may get address conflicts with other bootloaders, say
45 # Sun's ufsboot, so we'll pick a reasonably empty address.
51 CPPFLAGS
+= -I
${CURDIR}/..
/..
/..
-I
${CURDIR}/..
/..
/..
/..
-I
${CURDIR} -I.
52 CPPFLAGS
+= -I
${CURDIR}/..
/..
/..
/..
/..
/common
/include
53 CPPFLAGS
+= -DRELOC
=0x
${RELOC}
58 CPPFLAGS
+= -DSPARC_BOOT_AOUT
59 CPPFLAGS
+= -DSPARC_BOOT_ELF
60 CPPFLAGS
+= -DSPARC_BOOT_UFS
61 CPPFLAGS
+= -DSPARC_BOOT_NFS
62 #CPPFLAGS+= -DSPARC_BOOT_CD9660
64 ### find out what to use for libkern
66 .
include "${S}/lib/libkern/Makefile.inc"
69 ### find out what to use for libz
71 .
include "${S}/lib/libz/Makefile.inc"
74 ### find out what to use for libsa
76 SAMISCMAKEFLAGS
= SA_USE_LOADFILE
=yes SA_USE_CREAD
=yes
77 SAMISCCPPFLAGS
+= -DCOMPAT_SOLARIS_UFS
78 .
include "${S}/lib/libsa/Makefile.inc"
81 .if
!make
(obj
) && !make
(clean) && !make
(cleandir
)
83 @
([ -h machine
] || ln
-s
${S}/arch
/sparc64
/include machine
)
84 @
([ -h sparc64
] || ln
-s
${S}/arch
/sparc64
/include sparc64
)
85 @
([ -h sparc
] || ln
-s
${S}/arch
/sparc
/include sparc
)
86 .NOPATH
: machine sparc64 sparc
88 CLEANFILES
+= machine sparc64 sparc
90 cleandir
distclean: cleanlibdir
96 ${HOST_SH} ${S}/conf
/newvers_stand.sh
${CURDIR}/version
"sparc64" ${NEWVERSWHAT}
101 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
102 ${LD} -N
-p
-Ttext
${RELOC} -e
${ENTRY} >lderr
-o
${PROG} \
103 ${OBJS} -L
${SADST} -lsa
-L
${ZDST} -lz
-L
${KERNDST} -lkern
# solaris linker
105 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
106 ${LD} -X
-N
-Ttext
${RELOC} -e
${ENTRY} -o
${PROG} \
107 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} # native linker
110 .
include <bsd.prog.mk
>
112 .if
${MACHINE_ARCH} == "sparc64"
114 CEXTRAFLAGS?
= -D_LP64
116 AFLAGS
+= -Wa
,-Av8plusa
120 AFLAGS
+= -x assembler-with-cpp
-traditional-cpp
-D_LOCORE
-D__ELF__
121 CEXTRAFLAGS?
= -D_LP64
123 AFLAGS
+= -x assembler-with-cpp
-traditional-cpp
-D_LOCORE
-D__ELF__
${CEXTRAFLAGS}
126 NORMAL_S
= ${CC} ${AFLAGS} ${CPPFLAGS} -c
$<
130 # Explicit dependency for this.