-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (51 loc) · 2.26 KB
/
Makefile
File metadata and controls
66 lines (51 loc) · 2.26 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# ReelVault - Film Collection Browser
# Makefile for building the application
CC = gcc
PKGS = gtk+-3.0 sqlite3 libcurl json-c
CFLAGS = -Wall -Wextra -g -O2 $(shell pkg-config --cflags $(PKGS))
# Some distros don't ship a pkg-config file for TurboJPEG (libturbojpeg.pc).
# The header is typically in a default include path, and linking with -lturbojpeg
# is sufficient.
TURBOJPEG_LIBS ?= $(shell pkg-config --libs libturbojpeg 2>/dev/null || echo -lturbojpeg)
LDFLAGS = $(shell pkg-config --libs $(PKGS)) $(TURBOJPEG_LIBS) -lpthread
DEPFLAGS = -MMD -MP
SRC_DIR = src
BUILD_DIR = build
TARGET = reelvault
SOURCES = $(wildcard $(SRC_DIR)/*.c)
OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=$(BUILD_DIR)/%.o)
DEPS = $(OBJECTS:.o=.d)
.PHONY: all clean install uninstall test
all: $(BUILD_DIR) $(TARGET)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ $(LDFLAGS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
-include $(DEPS)
clean:
rm -rf $(BUILD_DIR) $(TARGET)
install: $(TARGET)
install -Dm755 $(TARGET) $(DESTDIR)/usr/bin/$(TARGET)
install -Dm644 data/reelvault.desktop $(DESTDIR)/usr/share/applications/reelvault.desktop
install -Dm644 data/icons/reelvault.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/reelvault.svg
uninstall:
rm -f $(DESTDIR)/usr/bin/$(TARGET)
rm -f $(DESTDIR)/usr/share/applications/reelvault.desktop
rm -f $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/reelvault.svg
test:
@echo "Tests not yet implemented"
# Header dependencies
$(BUILD_DIR)/main.o: $(SRC_DIR)/app.h
$(BUILD_DIR)/window.o: $(SRC_DIR)/app.h $(SRC_DIR)/window.h $(SRC_DIR)/grid.h $(SRC_DIR)/filter.h
$(BUILD_DIR)/grid.o: $(SRC_DIR)/app.h $(SRC_DIR)/grid.h $(SRC_DIR)/db.h
$(BUILD_DIR)/detail.o: $(SRC_DIR)/app.h $(SRC_DIR)/detail.h $(SRC_DIR)/player.h
$(BUILD_DIR)/match.o: $(SRC_DIR)/app.h $(SRC_DIR)/match.h $(SRC_DIR)/scraper.h
$(BUILD_DIR)/filter.o: $(SRC_DIR)/app.h $(SRC_DIR)/filter.h $(SRC_DIR)/db.h
$(BUILD_DIR)/db.o: $(SRC_DIR)/db.h
$(BUILD_DIR)/scanner.o: $(SRC_DIR)/scanner.h $(SRC_DIR)/db.h $(SRC_DIR)/utils.h
$(BUILD_DIR)/scraper.o: $(SRC_DIR)/scraper.h $(SRC_DIR)/db.h $(SRC_DIR)/config.h
$(BUILD_DIR)/config.o: $(SRC_DIR)/config.h
$(BUILD_DIR)/player.o: $(SRC_DIR)/player.h $(SRC_DIR)/config.h
$(BUILD_DIR)/utils.o: $(SRC_DIR)/utils.h