File: Makefile

package info (click to toggle)
torch 2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,488 kB
  • ctags: 3,217
  • sloc: cpp: 14,272; makefile: 201
file content (42 lines) | stat: -rw-r--r-- 1,079 bytes parent folder | download
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
major=2
minor=0
micro=0

shlib=libtorch.so.$(major).$(minor).$(micro)

all: $(shlib) libtorch.so.$(major) libtorch.so

VPATH=../kernel:../matrix:../addons:../distributions:../data_formats

include ../Makefile.prefix
include ../Makefile.libs.common

include ../kernel/Makefile.files
include ../matrix/Makefile.files
include ../addons/Makefile.files
include ../distributions/Makefile.files
include ../data_formats/Makefile.files

# See the Linux GCC HOWTO section 6.4.2.2, "ELF shared libraries"

CXXFLAGS += -fPIC
LDFLAGS=--shared -Wl,-soname=libtorch.so.$(major) -s

$(shlib): $(OFILES)
	$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES)

libtorch.so.$(major):
	ln -sf $(shlib) libtorch.so.$(major)

libtorch.so:
	ln -sf libtorch.so.$(major) libtorch.so

TOCLEAN += libtorch.so{.$(major){.$(minor).$(micro),},}

install: $(shlib) libtorch.so.$(major) libtorch.so
	-install --directory $(DESTDIR)$(libdir)
	$(INSTALL_DATA) $(shlib) $(DESTDIR)$(libdir)/
	cp -af libtorch.so{.$(major),} $(DESTDIR)$(libdir)/

uninstall:
	-rm -f $(DESTDIR)$(libdir)/libtorch.so{.$(major){,.$(minor).$(micro)},}