-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.16 KB
/
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
48
49
50
# dependencies: libavformat-dev libavcodec-dev libglm-dev
# Vulkan Instance Version: 1.2.178
# NVIDIA Driver Version: 455.50.19
# Ubuntu 18.04 LTS
TARGET=main
BUILD_DIR=build
SOURCE_DIR=src
INCLUDE_DIR=include
INCLUDES=-I$(SOURCE_DIR) -I$(INCLUDE_DIR)
CXX=g++
CXXFLAGS=-O2 \
-pthread \
-std=c++17 \
$(INCLUDES)
LD=$(CXX)
LDFLAGS=-lpthread -lvulkan -lavformat -lavcodec
LIB_NVIDIA_VIDEO_PARSER_DIR=bin/libs/nv_vkvideo_parser/linux_amd64_release
LIB_NVIDIA_VIDEO_PARSER_RPATH=-Wl,-rpath=$(LIB_NVIDIA_VIDEO_PARSER_DIR)
LIB_NVIDIA_VIDEO_PARSER=-L$(LIB_NVIDIA_VIDEO_PARSER_DIR) -lnvidia-vkvideo-parser $(LIB_NVIDIA_VIDEO_PARSER_RPATH)
#LIB_GLFW=$(shell pkg-config --libs glfw3)
LIBS=$(LIB_NVIDIA_VIDEO_PARSER)
SOURCES=$(shell find $(SOURCE_DIR) -name '*.cc')
OBJECTS=$(patsubst $(SOURCE_DIR)/%.cc, $(BUILD_DIR)/%.o, $(SOURCES))
HEADERS=$(shell find $(SOURCE_DIR) -name '*.h') $(shell find $(SOURCE_DIR) -name '*.inc')
.PHONY: all
all: $(TARGET)
.PHONY: clean
clean:
rm -r $(BUILD_DIR)
rm -f $(TARGET)
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.cc $(HEADERS)
@mkdir -p "$(@D)"
$(CXX) $(CXXFLAGS) -c $< -o $@
$(TARGET): $(OBJECTS)
$(LD) -o $(TARGET) $(OBJECTS) $(LIBS) $(LDFLAGS)