-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (43 loc) · 1.54 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
53
54
SOURCES := $(wildcard src/*.c)
OBJECTS := $(patsubst src/%.c, src/%.o, $(SOURCES))
PSOURCES := $(wildcard po/*.po)
MOBJECTS := $(patsubst po/%.po, po/%.mo, $(PSOURCES))
CFLAGS := `pkg-config --cflags gtksourceview-4`
LDLIBS := `pkg-config --libs gtksourceview-4`
debug: CFLAGS += -g -Og -Wall
debug: titan
release: CFLAGS += -O3
release: titan
strip $<
titan: $(OBJECTS) $(MOBJECTS)
$(CC) $(OBJECTS) -o $@ $(LDLIBS) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
%.mo: %.po
msgfmt -o $@ $<
update:
xgettext $(SOURCES) --keyword=_ -o po/titan.pot
$(foreach po, $(PSOURCES), msgmerge --update $(po) po/titan.pot;)
rm -f po/*.po~
clean:
rm -f $(OBJECTS)
rm -f $(MOBJECTS)
rm -f titan
install: release
install -Dm755 titan $(DESTDIR)/usr/bin/titan
install -Dm644 data/titan.png $(DESTDIR)/usr/share/icons/hicolor/256x256/apps/titan.png
install -Dm644 data/titan.desktop $(DESTDIR)/usr/share/applications/titan.desktop
$(foreach object, $(MOBJECTS), install -Dm644 $(object) $(DESTDIR)/usr/share/locale/$(notdir $(basename $(object)))/LC_MESSAGES/titan.mo;)
uninstall:
rm /usr/bin/titan
rm /usr/share/icons/hicolor/256x256/apps/titan.png
rm /usr/share/applications/titan.desktop
$(foreach object, $(MOBJECTS), rm /usr/share/locale/$(notdir $(basename $(object)))/LC_MESSAGES/titan.mo;)
appdir: $(MOBJECTS)
mkdir -p appdir
cp data/titan.desktop appdir/
ln -fs usr/bin/titan appdir/AppRun
ln -fs usr/share/icons/hicolor/256x256/apps/titan.png appdir/titan.png
appimage: DESTDIR += appdir
appimage: appdir install
appimagetool appdir