summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/clang/llvm-objcopy/Makefile
blob: fd602ff998ba5db3505aef6075bc2d59df37c107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# $OpenBSD: Makefile,v 1.3 2023/01/19 00:18:19 kettenis Exp $

.include <bsd.own.mk>

PROG=	llvm-objcopy
MAN=	llvm-objcopy.1
BINDIR=	/usr/bin
LIBEXECDIR=/usr/libexec

SRCS=	ConfigManager.cpp \
	llvm-objcopy.cpp \
	COFFObjcopy.cpp \
	COFFObject.cpp \
	COFFReader.cpp \
	COFFWriter.cpp \
	ELFObjcopy.cpp \
	ELFObject.cpp \
	MachOObjcopy.cpp \
	MachOReader.cpp \
	MachOWriter.cpp \
	MachOLayoutBuilder.cpp \
	MachOObject.cpp \
	WasmObject.cpp \
	WasmReader.cpp \
	WasmWriter.cpp \
	WasmObjcopy.cpp

.if ${LINKER_VERSION:L} == "lld"
LINKS=	${BINDIR}/llvm-objcopy ${BINDIR}/strip
MAN+=	strip.1
.endif

COFFObject.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF/Object.cpp $@

COFFReader.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF/Reader.cpp $@

COFFWriter.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF/Writer.cpp $@

ELFObject.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/ELF/Object.cpp $@

MachOObject.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/MachO/Object.cpp $@

WasmObject.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm/Object.cpp $@

WasmReader.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm/Reader.cpp $@

WasmWriter.cpp:
	ln -s ${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm/Writer.cpp $@

CPPFLAGS+=	-I${.OBJDIR}/../include/llvm-objcopy
CPPFLAGS+=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy
CPPFLAGS+=	${CPPFLAGS_$*}

CPPFLAGS_COFFObject=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF
CPPFLAGS_COFFReader=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF
CPPFLAGS_COFFWriter=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF
CPPFLAGS_ELFObject=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/ELF
CPPFLAGS_MachOObject=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/MachO
CPPFLAGS_WasmObject=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm
CPPFLAGS_WasmReader=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm
CPPFLAGS_WasmWriter=	-I${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm

.PATH:	${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy
.PATH:	${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/COFF
.PATH:	${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/ELF
.PATH:	${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/MachO
.PATH:	${.CURDIR}/../../../llvm/llvm/tools/llvm-objcopy/wasm

LLVM_LIBDEPS=	LLVM

LDADD+= -L ${.OBJDIR}/../libLLVM -lLLVM

CLEANFILES+=	COFFObject.cpp COFFReader.cpp COFFWriter.cpp
CLEANFILES+=	ELFObject.cpp MachOObject.cpp
CLEANFILES+=	WasmObject.cpp WasmReader.cpp WasmWriter.cpp

.include <bsd.prog.mk>