-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (32 loc) · 1.26 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
CXX = g++
CXXFLAGS = -std=c++14 -Wall -Wno-deprecated-declarations -Wfloat-conversion
DEBUGFLAGS = -DDEBUG
LDFLAGS = -L/home/gluo/local_lib/TensorRT-8.6.1.6/lib -Wno-deprecated-declarations
LDLIBS = -lnvinfer -lnvonnxparser -lcudart -lnvinfer_plugin
# Add the directory containing NvInfer.h to the include path
INCLUDEDIRS = -I/home/gluo/local_lib/TensorRT-8.6.1.6/include -Isrc
SRCDIR = src
BINDIR = bin
SOURCES = $(wildcard $(SRCDIR)/*.cpp) main.cpp
SOURCES_C = $(wildcard $(SRCDIR)/*.cpp) main.c
OBJECTS = $(SOURCES:$(SRCDIR)/%.cpp=$(BINDIR)/%.o)
OBJECTS_C = $(SOURCES_C:$(SRCDIR)/%.cpp=$(BINDIR)/%.o)
SOURCES_G = $(wildcard $(SRCDIR)/*.cpp) gaussian_blur.cpp
OBJECTS_G = $(SOURCES_G:$(SRCDIR)/%.cpp=$(BINDIR)/%.o)
EXECUTABLE = main
EXECUTABLE_C = main_c
EXECUTABLE_G = gaussian_blur
.PHONY: all clean
all: $(EXECUTABLE) $(EXECUTABLE_C) $(EXECUTABLE_G)
$(BINDIR)/%.o: $(SRCDIR)/%.cpp | $(BINDIR)
$(CXX) $(CXXFLAGS) $(DEBUGFLAGS) $(INCLUDEDIRS) -c $< -o $@
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(INCLUDEDIRS) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(EXECUTABLE_C): $(OBJECTS_C)
$(CXX) $(INCLUDEDIRS) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(EXECUTABLE_G): $(OBJECTS_G)
$(CXX) $(INCLUDEDIRS) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(BINDIR):
mkdir -p $(BINDIR)
clean:
rm -rf $(BINDIR) $(EXECUTABLE)