-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (40 loc) · 1.51 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
51
52
.DEFAULT_GOAL := mkvtagger
GPPPARAMS = -g -Wall -Wno-unknown-pragmas --std=c++14 -O0 -I./include
ARPARAMS = rs
TST_DIR = test
SRC_DIR = src
OBJ_DIR = obj
BIN_DIR = bin
EBMLLIBRARY = libebmlparser.a
TMDBLIBRARY = libtmdb.a
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
mkdir -p $(@D)
g++ $(GPPPARAMS) -o $@ -c $<
EBMLSRC = $(wildcard $(SRC_DIR)/EBMLTools/*.cpp)
EBMLOBJ = $(EBMLSRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
$(EBMLLIBRARY): $(BIN_DIR)/$(EBMLLIBRARY)
$(BIN_DIR)/$(EBMLLIBRARY): $(EBMLOBJ)
mkdir -p $(@D)
ar $(ARPARAMS) $@ $^
TMDBSRC = $(wildcard $(SRC_DIR)/TMDB/*.cpp)
TMDBOBJ = $(TMDBSRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
$(TMDBLIBRARY): $(BIN_DIR)/$(TMDBLIBRARY)
$(BIN_DIR)/$(TMDBLIBRARY): $(TMDBOBJ)
mkdir -p $(@D)
ar $(ARPARAMS) $@ $^
clean:
rm -rf $(OBJ_DIR) $(BIN_DIR) ./data/test.mkv
_install: mkvtagger
sudo cp ./bin/mkvtagger /usr/bin/mkv-tagger
install: _install clean
uninstall:
sudo rm /usr/bin/mkv-tagger
ebmltest: $(BIN_DIR)/$(EBMLLIBRARY)
g++ $(GPPPARAMS) $(TST_DIR)/ebmltest.cpp $(BIN_DIR)/$(EBMLLIBRARY) -o $(BIN_DIR)/ebmltest
cp ./data/test1.mkv ./data/test.mkv
./$(BIN_DIR)/ebmltest ./data/test.mkv
tmdbtest: $(BIN_DIR)/$(TMDBLIBRARY)
g++ $(GPPPARAMS) $(TST_DIR)/tmdbtest.cpp $(BIN_DIR)/$(TMDBLIBRARY) -o $(BIN_DIR)/tmdbtest -ljsoncpp -lcurl
./$(BIN_DIR)/tmdbtest
mkvtagger: $(BIN_DIR)/$(TMDBLIBRARY) $(BIN_DIR)/$(EBMLLIBRARY)
g++ $(GPPPARAMS) $(SRC_DIR)/mkvtagger.cpp $(BIN_DIR)/$(TMDBLIBRARY) $(BIN_DIR)/$(EBMLLIBRARY) -o $(BIN_DIR)/mkvtagger -ljsoncpp -lcurl