125 lines
3.7 KiB
Makefile
125 lines
3.7 KiB
Makefile
CC ?= clang
|
|
CXX ?= clang++
|
|
CFLAGS ?= -O2 -Wall -Wextra -std=c++11
|
|
PREFIX ?= /usr/local/bin
|
|
APPDIR ?= /usr/share/applications
|
|
ICONDIR ?= /usr/share/icons/hicolor
|
|
|
|
GTKFLAGS = `pkg-config gtkmm-3.0 --cflags`
|
|
GTKLIBS = `pkg-config gtkmm-3.0 --libs`
|
|
|
|
.PHONY: default
|
|
default: tv_rename
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f *.o tv_rename tv_rename_gui
|
|
|
|
.PHONY: install
|
|
install: tv_rename
|
|
install -d $(PREFIX)/
|
|
install -m 755 tv_rename $(PREFIX)/
|
|
|
|
.PHONY: install_gui
|
|
install_gui: gui
|
|
install -d $(PREFIX)/
|
|
install -m 755 tv_rename_gui $(PREFIX)/
|
|
install -d $(APPDIR)
|
|
install -m 755 tv_rename_gui.desktop $(APPDIR)/
|
|
install -d $(ICONDIR)
|
|
install -m 644 tv_rename.svg $(ICONDIR)/scalable/apps/
|
|
gtk-update-icon-cache -f $(ICONDIR)
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
rm $(PREFIX)/tv_rename
|
|
|
|
.PHONY: uninstall_gui
|
|
uninstall_gui:
|
|
rm $(PREFIX)/tv_rename_gui
|
|
rm $(APPDIR)/tv_rename_gui.desktop
|
|
rm $(ICONDIR)/scalable/apps/tv_rename.svg
|
|
gtk-update-icon-cache -f $(ICONDIR)
|
|
|
|
tv_rename: functions.o filesystem.o network.o tv_rename.o progress.o main.o
|
|
$(CXX) $(CFLAGS) -o tv_rename main.o tv_rename.o functions.o\
|
|
filesystem.o network.o progress.o -lcurl -lsqlite3
|
|
strip tv_rename
|
|
|
|
filesystem.o: unix/filesystem.cpp
|
|
$(CXX) $(CFLAGS) -c unix/filesystem.cpp -o filesystem.o
|
|
|
|
functions.o: functions.cpp
|
|
$(CXX) $(CFLAGS) -c functions.cpp
|
|
|
|
network.o: unix/network.cpp
|
|
$(CXX) $(CFLAGS) -c unix/network.cpp
|
|
|
|
tv_rename.o: tv_rename.cpp
|
|
$(CXX) $(CFLAGS) -c tv_rename.cpp
|
|
|
|
progress.o: progress.cpp
|
|
$(CXX) $(CFLAGS) -c progress.cpp
|
|
|
|
main.o: main.cpp
|
|
$(CXX) $(CFLAGS) -c main.cpp
|
|
|
|
.PHONY: gui
|
|
gui: tv_rename_gui
|
|
|
|
tv_rename_gui: gui.o mainwindow.o seasonwindow.o databasewindow.o\
|
|
searchwindow.o gtkfunctions.o network.o functions_gui.o\
|
|
filesystem_u_gui.o tv_rename_gui.o progress_gui.o\
|
|
progresswindow.o
|
|
$(CXX) $(CFLAGS) -o $@ $^ $(GTKFLAGS) $(GTKLIBS) -lcurl -lsqlite3
|
|
strip tv_rename_gui
|
|
|
|
filesystem_u_gui.o: unix/filesystem.cpp
|
|
$(CXX) $(CFLAGS) -c unix/filesystem.cpp -o filesystem_u_gui.o -DGUI
|
|
|
|
functions_gui.o: functions.cpp
|
|
$(CXX) $(CFLAGS) -c functions.cpp -o functions_gui.o -DGUI
|
|
|
|
tv_rename_gui.o: tv_rename.cpp
|
|
$(CXX) $(CFLAGS) -c tv_rename.cpp -o tv_rename_gui.o -DGUI
|
|
|
|
gui.o: gui.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
mainwindow.o: mainwindow.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
seasonwindow.o: seasonwindow.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
databasewindow.o: databasewindow.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
searchwindow.o: searchwindow.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
gtkfunctions.o: gtkfunctions.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
progress_gui.o: progress.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
progresswindow.o: progresswindow.cpp
|
|
$(CXX) $(CFLAGS) -o $@ -c $^ $(GTKFLAGS) -DGUI
|
|
|
|
.PHONY: windows
|
|
windows: tv_rename.exe
|
|
|
|
tv_rename.exe: tv_rename.cpp functions.cpp windows/filesystem.cpp\
|
|
windows/network.cpp progress.cpp sqlite3.c main.cpp
|
|
$(CXX) -MD -EHsc -Fe"tv_rename" tv_rename.cpp windows/filesystem.cpp\
|
|
functions.cpp windows/network.cpp progress.cpp sqlite3.c main.cpp\
|
|
-D_WIN32 -DUNICODE -link wininet.lib shlwapi.lib ole32.lib\
|
|
shell32.lib user32.lib
|
|
|
|
.PHONY: windows_gui
|
|
windows_gui: tv_rename_gui.exe
|
|
|
|
tv_rename_gui.exe: tv_rename_gui.res tv_rename_gui.cpp tv_rename.cpp\
|
|
windows/filesystem.cpp functions.cpp windows/network.cpp
|
|
$(CXX) -MD -EHsc -Fe"tv_rename_gui" tv_rename_gui.cpp tv_rename.cpp\
|
|
windows/filesystem.cpp functions.cpp windows/network.cpp -D_WIN32\
|
|
-DUNICODE -DGUI -link wininet.lib shlwapi.lib ole32.lib shell32.lib\
|
|
gdi32.lib user32.lib tv_rename_gui.res
|
|
|
|
tv_rename_gui.res: tv_rename_gui.rc
|
|
rc tv_rename_gui.rc
|