aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9c9eb0853b0dd923c7c2f1d8ecc32b8aa4371285 (plain)
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
LIBS=gtkmm-3.0
override CXXFLAGS += -MMD -Wall `pkg-config $(LIBS) --cflags`
override LDFLAGS += -pthread -lbible `pkg-config $(LIBS) --libs`
SOURCES=$(wildcard src/*.cc)
OBJECTS=$(SOURCES:.cc=.o)
DEPS = $(OBJECTS:.o=.d)
EXECUTABLE=biblereader
PREFIX ?= /usr
EXEC_PREFIX ?= $(PREFIX)
BINDIR ?= $(EXEC_PREFIX)/bin

$(EXECUTABLE): $(OBJECTS)
	$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)

-include $(DEPS)

install: $(EXECUTABLE)
	install -d $(DESTDIR)$(BINDIR)
	install -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
	install -d $(DESTDIR)$(PREFIX)/share/applications/
	install -m 644 files/biblereader.desktop $(DESTDIR)$(PREFIX)/share/applications/
	install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
	install -m 644 files/biblereader_128.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/biblereader.png
	install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps/
	install -m 644 files/biblereader_64.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps/biblereader.png

.PHONY: clean
clean:
	$(RM) $(OBJECTS) $(DEPS) $(EXECUTABLE)