-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
47 lines (38 loc) · 894 Bytes
/
Makefile
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
OS=$(shell uname)
ifeq ($(OS), Linux)
INCDIR := /usr/local/cuda/include
LIBDIR := /usr/local/cuda/lib64
else
INCDIR := /usr/local/cuda/include
LIBDIR := /usr/local/cuda/lib
endif
CFLAGS=-I$(INCDIR)
LDFLAGS=-L$(LIBDIR)
SFLAGS=-Xcc $(CFLAGS) -Xlinker $(LDFLAGS)
DOCDIR=Documentation
gendoc=jazzy \
--clean \
--xcodebuild-arguments -scheme,CUDA \
--module $(1) \
--output $(DOCDIR)/$(1)
all:
swift build $(SFLAGS)
release:
swift build -c release $(SFLAGS)
test:
swift test $(SFLAGS)
update:
swift package update
xcodeproj:
swift package generate-xcodeproj
echo 'HEADER_SEARCH_PATHS = $(INCDIR)'\
'\nLIBRARY_SEARCH_PATHS = $(LIBDIR)'\
'\nLD_RUNPATH_SEARCH_PATHS = $(LIBDIR)'\
>> $(wildcard *.xcodeproj)/Configs/Project.xcconfig
doc:
$(call gendoc,CUDADriver)
$(call gendoc,CUDARuntime)
$(call gendoc,NVRTC)
$(call gendoc,CuBLAS)
clean:
swift build --clean