1# $FreeBSD$
2
3
4# BINDIR
5.include "${.CURDIR}/../../Makefile.inc"
6.include "${.CURDIR}/../Makefile.inc0"
7.include <src.opts.mk>
8
9.PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config
10
11.if ${TARGET_ARCH:Marm*} || ${TARGET_ARCH} == "powerpc64"
12NO_WERROR.clang=
13.endif
14
15PROG=	as
16SRCS+=	app.c \
17	as.c \
18	atof-generic.c \
19	atof-ieee.c \
20	cond.c \
21	depend.c \
22	dw2gencfi.c \
23	dwarf2dbg.c \
24	ecoff.c \
25	ehopt.c \
26	expr.c \
27	flonum-copy.c \
28	flonum-konst.c \
29	flonum-mult.c \
30	frags.c \
31	hash.c \
32	input-file.c \
33	input-scrub.c \
34	listing.c \
35	literal.c \
36	macro.c \
37	messages.c \
38	obj-elf.c \
39	output-file.c \
40	read.c \
41	sb.c \
42	stabs.c \
43	subsegs.c \
44	symbols.c \
45	write.c
46# DEO: why not used?
47#SRCS+=	itbl-ops.c
48
49.if ${TARGET_ARCH:Marmv6*} != ""
50CFLAGS+=	-DCPU_DEFAULT=ARM_ARCH_V6K
51.endif
52.if ${TARGET_ARCH:Marmv7*} != ""
53CFLAGS+=	-DCPU_DEFAULT=ARM_ARCH_V7A
54.endif
55
56.if ${TARGET_CPUARCH} == "mips"
57SRCS+=	itbl-ops.c itbl-parse.y itbl-lex.l
58.if ${TARGET_ARCH:Mmips64*} != ""
59CFLAGS+=	-DMIPS_DEFAULT_ABI=N64_ABI -DMIPS_DEFAULT_64BIT=1
60.elif ${TARGET_ARCH:Mmipsn32*} != ""
61CFLAGS+=	-DMIPS_DEFAULT_ABI=N32_ABI
62.else
63MIPS_ABI_DEFAULT=ABI_32
64.endif
65.endif
66
67.if ${TARGET_ARCH} == "amd64"
68SRCS+=	tc-i386.c
69.elif ${TARGET_CPUARCH} == "powerpc"
70SRCS+=	tc-ppc.c
71.elif ${TARGET_ARCH} == "sparc64"
72SRCS+=	tc-sparc.c
73.else
74SRCS+=	tc-${TARGET_CPUARCH}.c
75.endif
76
77.if ${TARGET_ARCH} == "sparc64"
78CFLAGS+= -DDEFAULT_ARCH=\"v9-64\"
79.else
80CFLAGS+= -DDEFAULT_ARCH=\"${BINUTILS_ARCH}\"
81.endif
82.if defined(TARGET_BIG_ENDIAN)
83CFLAGS+= -DTARGET_BYTES_BIG_ENDIAN=1
84.endif
85CFLAGS+= -DTARGET_CPU=\"${BINUTILS_ARCH}\"
86CFLAGS+= -DTARGET_OS=\"${TARGET_OS}\"
87CFLAGS+= -DTARGET_CANONICAL=\"${TARGET_TUPLE}\"
88CFLAGS+= -DTARGET_ALIAS=\"${TARGET_TUPLE}\"
89CFLAGS+= -DVERSION=\"${VERSION}\"
90CFLAGS+= -D_GNU_SOURCE
91CFLAGS+= -I${SRCDIR}/gas -I${SRCDIR}/bfd -I${SRCDIR}/gas/config -I${SRCDIR}
92CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd
93
94.if ${MK_SHARED_TOOLCHAIN} == "no"
95NO_SHARED?=	yes
96.endif
97
98DPADD=	${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
99DPADD+=	${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
100DPADD+=	${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a
101LDADD=	${DPADD}
102
103.include <bsd.prog.mk>
104