-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.llvm
36 lines (27 loc) · 934 Bytes
/
Makefile.llvm
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
CPP = clang++
CPP_FLAGS = -fsycl -std=c++14
# See
# https://github.com/jinge90/llvm/blob/sycl/sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
# and
# https://github.com/jinge90/llvm/blob/sycl/sycl/test/devicelib/std_complex_math_fp64_test.cpp
DPCPP_LIBDIR ?= /opt/isycl/lib
COMPLEX_OBJS = libsycl-complex-fp64.o libsycl-cmath-fp64.o
COMPLEX_LIBS = $(addprefix $(DPCPP_LIBDIR)/,$(COMPLEX_OBJS))
DPCPP_INCDIR ?= /opt/isycl/include/sycl
CPP_FLAGS += -I$(DPCPP_INCDIR)
BUILD_DIR=build-llvm
SYCL_SOURCES = $(wildcard *.cxx)
EXES = $(addprefix $(BUILD_DIR)/,$(basename $(SYCL_SOURCES)))
.PHONY: all
all: $(EXES)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/% : %.cxx | $(BUILD_DIR)
@echo "Compiling "$<
$(CPP) $(CPP_FLAGS) -o $@ $<
$(BUILD_DIR)/complex : complex.cxx | $(BUILD_DIR)
@echo "Compiling "$<
$(CPP) $(CPP_FLAGS) -fsycl-device-lib=libm-fp64 -o $@ $<
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)/*