aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 496aac6350abd15d7de3eb8bde6e86c7c7a61f12 (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
30
31
CC=g++
LIBS=gtkmm-3.0
CFLAGS=-c -Wall
LDLIBS=-pthread -lbible
SOURCES=header.cc main.cc mods.cc readerview.cc sword.cc
OBJECTS=$(SOURCES:.cc=.o)
EXECUTABLE=biblereader
ifeq ($(PREFIX),)
    PREFIX := /usr
endif

all: $(SOURCES) $(EXECUTABLE) 

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

$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(OBJECTS) -o $@ $(LDFLAGS) `pkg-config $(LIBS) --libs` $(LDLIBS)

.cc.o:
	$(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`

clean:
	rm -rf *.o $(EXECUTABLE)