-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (49 loc) · 1.53 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
55
56
57
58
59
60
61
SRC := $(wildcard src/*.c)
OBJ := $(addprefix obj/, $(notdir $(SRC:.c=.o)))
CFLAGS := -g -D BG_DEBUG -Wall -I include $(shell pkg-config --cflags gtk+-3.0)
LFLAGS := $(shell pkg-config --libs gtk+-3.0) -lm
ifeq ($(OS), Windows_NT)
BIN := bin/backgammon.exe
RM := rmdir /s /q obj bin
else
BIN := bin/backgammon
RM := rm -rf obj/ bin/
endif
all: $(BIN)
$(BIN): $(OBJ) | bin
gcc $(CFLAGS) $(OBJ) -o $(BIN) $(LFLAGS)
obj/%.o: src/%.c | obj
gcc -MD $(CFLAGS) $< -o $@ -c
-include obj/*.d
obj:
mkdir obj
bin:
mkdir bin
.PHONY=clean
clean:
$(RM)
ifeq ($(OS), Windows_NT)
run: $(BIN)
$(BIN)
else
run: $(BIN)
./$(BIN)
endif
transl_start:
mkdir -p po/es/LC_MESSAGES
mkdir -p po/fr/LC_MESSAGES
xgettext --keyword=_ --add-comments --sort-output \
-o po/backgammon.pot $(SRC) $(wildcard ui/*.glade)
msginit --input=po/backgammon.pot --locale=es_ES.UTF-8 --output=po/es/backgammon.po
msginit --input=po/backgammon.pot --locale=fr_FR.UTF-8 --output=po/fr/backgammon.po
msgfmt --output-file=po/es/LC_MESSAGES/backgammon.mo po/es/backgammon.po
msgfmt --output-file=po/fr/LC_MESSAGES/backgammon.mo po/fr/backgammon.po
transl_update:
mkdir -p po/es/LC_MESSAGES
mkdir -p po/fr/LC_MESSAGES
xgettext --keyword=_ --add-comments --sort-output \
-o po/backgammon.pot $(SRC) $(wildcard ui/*.glade)
msgmerge --update po/es/backgammon.po po/backgammon.pot
msgmerge --update po/fr/backgammon.po po/backgammon.pot
msgfmt --output-file=po/es/LC_MESSAGES/backgammon.mo po/es/backgammon.po
msgfmt --output-file=po/fr/LC_MESSAGES/backgammon.mo po/fr/backgammon.po