-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (28 loc) · 972 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
CC = nvcc
CFLAGS = -arch=compute_61 -code=sm_61
RED := \033[31m
GREEN := \033[32m
YELLOW := \033[33m
BLUE := \033[34m
RESET := \033[0m
# The @ makes sure that the command itself isn't echoed in the terminal
help: # Print help on Makefile
@echo "Please use 'make <target>' where <target> is one of"
@echo ""
@grep '^[^.#]\+:\s\+.*#' Makefile | \
sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"` \1`printf "\033[0m"` \3 [\2]/" | \
expand -35
@echo ""
@echo "Check the Makefile to know exactly what each target is doing."
clean: # Remove all generated binaries
@rm -rf columnarc columnard *_test
.ONESHELL:
build: clean # Build the server
@sudo ln -s /usr/bin/gcc-13 /usr/local/cuda/bin/gcc || true
@sudo ln -s /usr/bin/g++-13 /usr/local/cuda/bin/g++ || true
$(CC) $(CFLAGS) -g -o $(script) src/$(script).cu
.PHONY:
.ONESHELL:
run: build # Build and launch the cuda code `make run script=<>`
@killall $(script) 2>/dev/null
time ./$(script)