-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.in
131 lines (107 loc) · 3.79 KB
/
Makefile.in
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
CXX = @CXX@
CPPFLAGS = @CPPFLAGS@
CPPFLAGS_EXTRA = -DPKGVERSION="\"@PKGVERSION@\"" \
-DREPORT_BUGS_TO="\"@REPORT_BUGS_TO@\""
DEFS = @DEFS@
CPPFLAGS_ALL = $(DEFS) $(CPPFLAGS) $(CPPFLAGS_EXTRA)
WARN_CXXFLAGS = @WARN_CXXFLAGS@
WERROR = @WERROR@
CXXFLAGS = @CXXFLAGS@
CXXFLAGS_ALL = $(CXXFLAGS) $(WARN_CXXFLAGS) $(WERROR)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
DL_LIBS = @DL_LIBS@
NVPTX_RUN = @NVPTX_RUN@
# nvptx-tools developer's section.
#
# Letting 'configure' decide whether to build 'nvptx-none-run' (default) vs. force-enabling its build:
#NVPTX_RUN = nvptx-none-run
#
# Including the nvptx-tools-shipped 'include/cuda/cuda.h' (default) vs. system <cuda.h>:
#NVPTX_RUN_CPPFLAGS += -DNVPTX_RUN_INCLUDE_SYSTEM_CUDA_H
#NVPTX_RUN_CPPFLAGS += -I[CUDA]/include
#
# 'dlopen'ing the CUDA Driver library (default):
NVPTX_RUN_LDFLAGS += $(DL_LIBS)
# ... vs. linking it:
#NVPTX_RUN_CPPFLAGS += -DNVPTX_RUN_LINK_LIBCUDA
#NVPTX_RUN_LDFLAGS += -L[CUDA]/lib64/stubs
#NVPTX_RUN_LDFLAGS += -lcuda
# See <https://github.com/SourceryTools/nvptx-tools/pull/21> 'Work around "libnvidia-fatbinaryloader.so needed by libcuda.so" linking issue'.
#NVPTX_RUN_LDFLAGS += -Wl,--allow-shlib-undefined
AR = @AR@
RANLIB = @RANLIB@
LIT = @LIT@
LITFLAGS =
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
srcdir = @srcdir@
mkinstalldirs = $(SHELL) $(srcdir)/mkinstalldirs
PROGRAMS = nvptx-none-as nvptx-none-ld nvptx-none-nm $(NVPTX_RUN)
all: $(PROGRAMS)
libiberty.stmp:
cd libiberty/ && $(MAKE)
: > $@
nvptx-none-as: $(srcdir)/nvptx-as.cc libiberty.stmp $(srcdir)/version.h
$(CXX) $(CPPFLAGS_ALL) $(CXXFLAGS_ALL) -I$(srcdir)/include \
$< -o $@ \
-Llibiberty -liberty $(LDFLAGS) $(LIBS)
nvptx-none-ld: $(srcdir)/nvptx-ld.cc libiberty.stmp $(srcdir)/version.h
$(CXX) $(CPPFLAGS_ALL) $(CXXFLAGS_ALL) -I$(srcdir)/include \
$< -o $@ \
-Llibiberty -liberty $(LDFLAGS) $(LIBS)
nvptx-none-nm: $(srcdir)/nvptx-nm.cc libiberty.stmp $(srcdir)/version.h
$(CXX) $(CPPFLAGS_ALL) $(CXXFLAGS_ALL) -I$(srcdir)/include \
$< -o $@ \
-Llibiberty -liberty $(LDFLAGS) $(LIBS)
nvptx-none-run: $(srcdir)/nvptx-run.cc libiberty.stmp $(srcdir)/version.h
$(CXX) $(CPPFLAGS_ALL) $(CXXFLAGS_ALL) -I$(srcdir)/include \
$< -o $@ \
-Llibiberty -liberty $(LDFLAGS) $(LIBS) \
$(NVPTX_RUN_CPPFLAGS) $(NVPTX_RUN_LDFLAGS)
# Testsuite
.PHONY: check
check:
# libiberty
check: check-libiberty
.PHONY: check-libiberty
check-libiberty: libiberty.stmp
cd libiberty/testsuite/ && $(MAKE) check
# lit
# Unless 'make' has been invoked in parallel mode ('-jN'), don't run lit in
# parallel mode (stable output). In parallel mode, don't pass a '-j' option to
# lit, instead let it figure out the number of tests to run in parallel; we
# don't know the 'N' parameter of the 'make' '-jN' option.
LITFLAGS_J = $(if $(filter -j%,$(MFLAGS)),,-j 1)
check: check-lit
.PHONY: check-lit
check-lit: all
ifeq ($(LIT),)
@echo >&2 Need lit to run the testsuite, see \'$(srcdir)/test/README\'
@exit 1
else
$(LIT) $(LITFLAGS_J) $(LITFLAGS) test
endif
.PHONY: install
install: all
$(mkinstalldirs) $(DESTDIR)$(bindir)
for x in $(PROGRAMS); do \
$(INSTALL_PROGRAM) -m 755 $$x $(DESTDIR)$(bindir)/$$x; \
done
rm -f $(DESTDIR)$(bindir)/nvptx-none-ar
rm -f $(DESTDIR)$(bindir)/nvptx-none-ranlib
ln -s $(AR) $(DESTDIR)$(bindir)/nvptx-none-ar
ln -s $(RANLIB) $(DESTDIR)$(bindir)/nvptx-none-ranlib
$(mkinstalldirs) $(DESTDIR)$(prefix)/nvptx-none
$(mkinstalldirs) $(DESTDIR)$(prefix)/nvptx-none/bin
rel=$$(perl -MFile::Spec -e 'print File::Spec->abs2rel(@ARGV)' \
$(DESTDIR)$(bindir) $(DESTDIR)$(prefix)/nvptx-none/bin) && \
for p in ar as ld nm ranlib; do \
rm -f $(DESTDIR)$(prefix)/nvptx-none/bin/"$$p" && \
ln -s "$$rel"/nvptx-none-"$$p" $(DESTDIR)$(prefix)/nvptx-none/bin/"$$p"; \
done