-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (32 loc) · 976 Bytes
/
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
PREFIX = /app
CSRCS = tally.c
LSRCS = tally.lua
BIN = tally
OBJS = $(patsubst %.lua, %_bytecode.o, $(LSRCS))
LIBS = -llua -ldl -lm -Wl,-E
CFLAGS = -L$(PREFIX)/lib $(LIBS)
APPID = ca.vlacroix.Tally
ifdef DEVEL
CFLAGS += -DDEVEL
APPID = ca.vlacroix.Tally.Devel
endif
DESKTOP_FILE = $(APPID).desktop
ICON = $(APPID).svg
SYMBOLIC = $(APPID)-symbolic.svg
METAINFO = $(APPID).metainfo.xml
all: $(BIN)
$(BIN): $(CSRCS) $(OBJS)
cc -o $@ $^ -L/app/lib $(CFLAGS)
%_bytecode.o: %.bytecode
ld -r -b binary -o $@ $^
%.bytecode: %.lua
luac -o $@ -- $^
.PHONY: clean install
clean:
rm -f tally tally_bytecode.o tally.bytecode
install: $(BIN)
install -D -m 0755 -t $(PREFIX)/bin $<
install -D -m 0644 -t $(PREFIX)/share/applications $(DESKTOP_FILE)
install -D -m 0644 -t $(PREFIX)/share/icons/hicolor/scalable/apps icons/$(ICON)
install -D -m 0644 -t $(PREFIX)/share/icons/hicolor/symbolic/apps icons/$(SYMBOLIC)
install -D -m 0644 -t $(PREFIX)/share/metainfo $(METAINFO)