forked from sujanamaithili/gpuLSM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 918 Bytes
/
Copy pathMakefile
File metadata and controls
51 lines (37 loc) · 918 Bytes
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
# Compiler and flags
NVCC := nvcc
CXXFLAGS := -w -Ikernels -Isrc --expt-relaxed-constexpr
# Source files
SRCS := src/main.cu
# Object files
OBJS := $(SRCS:.cu=.o)
# Executable
TARGET := GPULSM
# Example source and target
EXAMPLE_SRCS := src/example.cu
EXAMPLE_OBJS := $(EXAMPLE_SRCS:.cu=.o)
EXAMPLE_TARGET := GPULSM_example
# Default target
all: $(TARGET)
# Compile object files
%.o: %.cu
$(NVCC) $(CXXFLAGS) -c $< -o $@
# Link object files into executable
$(TARGET): $(OBJS)
$(NVCC) $(CXXFLAGS) $(OBJS) -o $(TARGET)
# Build the example
example: $(EXAMPLE_TARGET)
$(EXAMPLE_TARGET): $(EXAMPLE_OBJS)
$(NVCC) $(CXXFLAGS) $(EXAMPLE_OBJS) -o $(EXAMPLE_TARGET)
# Clean up build files
clean:
rm -f $(OBJS) $(TARGET)
# Clean up example files
example_clean:
rm -f $(EXAMPLE_OBJS) $(EXAMPLE_TARGET)
# Run the executable
run: $(TARGET)
./$(TARGET)
# Run the example
run_example: example
./$(EXAMPLE_TARGET)