1 # $NetBSD: Makefile,v 1.13 2015/03/28 07:03:23 matt Exp $
7 NOCLANGERROR
= # defined
11 # If the platform does not support shared libraries, we need to supply
12 # *something* for BFD-using programs to link against. Also provide an
13 # empty libinstall target so that libbfd.a does not get installed.
16 libinstall
: # do nothing
21 BFD_MACHINE_ARCH?
= ${MACHINE_ARCH
:C
/armv
[4-7]/arm
/}
23 DEFS_MK
=${.CURDIR
}/arch
/${BFD_MACHINE_ARCH}/defs.mk
25 .if exists
(${DEFS_MK})
28 DIST
= ${NETBSDSRCDIR}/external
/gpl3
/binutils
/dist
31 # MINIX: make sure sources are fetched, even when tools not built earlier
33 .
include "${.CURDIR}/../../../../../minix/Makefile.fetchgnu"
34 .
endif # defined(__MINIX)
39 LIBDPLIBS
+= z
${.CURDIR
}/..
/..
/..
/..
/..
/lib
/libz
41 GCPPFLAGS
= ${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS}
42 CPPFLAGS
+= -I
${.CURDIR
}/arch
/${BFD_MACHINE_ARCH} -I
${DIST}/include -I. \
43 -I
${DIST}/bfd
${GCPPFLAGS
:M-D
*} ${GCPPFLAGS
:M-I
*:N-I.
*} \
44 -DDEBUGDIR
=\"${DEBUGDIR}\"
46 .if
(${BFD_MACHINE_ARCH} == "vax")
50 GSRCS
= ${G_libbfd_la_OBJECTS
:libbfd.lo
=lib_bfd.lo
} \
51 ${G_libbfd_la_DEPENDENCIES
:M
*.lo
}
54 DPSRCS
+= elf32-target.h elf64-target.h targmatch.h \
55 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \
57 CLEANFILES
+= elf32-target.h elf64-target.h targmatch.h \
58 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \
62 INFOFLAGS
= -I
${DIST}/bfd
/doc
64 .PATH
: ${DIST}/bfd
${DIST}/bfd
/doc
67 .
include <bsd.
info.mk
>
69 ${OBJS} ${SOBJS}: elf32-target.h elf64-target.h
70 targets.o targets.pico
: targmatch.h Makefile
72 .
include <bsd.prog.mk
> # do nothing
75 targmatch.h
: config.bfd targmatch.sed
77 ${TOOL_SED} -f
${.ALLSRC
:M
*.sed
} ${.ALLSRC
:M
*.bfd
} >$@
79 elf32-target.h
: elfxx-target.h
81 ${TOOL_SED} -e s
/NN
/32/g
< $> > $@
83 elf64-target.h
: elfxx-target.h
85 ${TOOL_SED} -e s
/NN
/64/g
< $> > $@
87 elf32-ia64.c
: elfnn-ia64.c
89 ${TOOL_SED} -e s
/NN
/32/g
< $> > $@
91 elf64-ia64.c
: elfnn-ia64.c
93 ${TOOL_SED} -e s
/NN
/64/g
< $> > $@
95 elf32-riscv.c
: elfnn-riscv.c
97 ${TOOL_SED} -e s
/NN
/32/g
< $> > $@
99 elf64-riscv.c
: elfnn-riscv.c
101 ${TOOL_SED} -e s
/NN
/64/g
< $> > $@
105 ${TOOL_SED} -e s
/XX
/pe
/g
< $> > $@
107 pepigen.c
: peXXigen.c
109 ${TOOL_SED} -e s
/XX
/pep
/g
< $> > $@
111 pex64igen.c
: peXXigen.c
113 ${TOOL_SED} -e s
/XX
/pex64
/g
< $> > $@
115 .if defined
(__MINIX
) && ${USETOOLS} != "yes"
116 # Trigger the fetch phase, even when not building tools
117 ${SRCS} realdepend realall realinstall
: ${fetch_done}
118 .
endif # defined(__MINIX)