-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 807 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
CXX=g++
CPPFLAGS=-Iinclude/obj-parser/src -Iinclude/ -I/opt/cuda/include
CXXFLAGS ?= -std=c++17 -Wall -Wextra -pedantic
LDFLAGS=-Linclude/obj-parser/ -L/opt/cuda/lib64
LDLIBS=-lm -lobjparser -lcudart
CUFLAGS= -lineinfo -std=c++14
ifdef DEBUG
CXXFLAGS += -O0 -g
CUFLAGS += -O0 -g
else
CXXFLAGS += -O3
CUFLAGS += -O3
endif
PPMDIR=output
BIN=rasterizer
CUOBJS=$(addprefix src/, gpu_operations.o device_bitset.o)
OBJS=$(addprefix src/, main.o rasterizer.o input_parser.o) $(CUOBJS)
ifdef BENCH
CPPFLAGS += -DBENCH
endif
all: libs $(BIN)
$(BIN): $(OBJS)
nvcc $(CPPFLAGS) -lineinfo $(LDFLAGS) -o $@ $^ $(LDLIBS)
%.o: %.cu
nvcc $(CPPFLAGS) -dc $< -o $@
libs:
make -C include/
clean:
$(RM) $(OBJS) $(BIN) $(PPMDIR)/* $(CUOBJS)
clean-all: clean
make clean -C include/
.PHONY: all libs clean clean-all