-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (60 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
76 lines (60 loc) · 2.26 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
NAME = TeslaViewer
SRCDIR = src
OBJDIR = obj
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
CXX = g++
CXXFLAGS = -Wall -O2 -std=c++17 -I$(SRCDIR) -MMD -MP
LDFLAGS = -lbe -lmedia -ltracker -ltranslation -llocalestub -lroot
APP_SIG = application/x-vnd.tesla-sentry-viewer
LOCALEDIR = locales
DEPS = $(OBJS:.o=.d)
all: $(NAME)
$(NAME): $(OBJS) $(NAME).rdef
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
rc -o $(NAME).rsrc $(NAME).rdef
xres -o $@ $(NAME).rsrc
mimeset -f $@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp | $(OBJDIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
-include $(DEPS)
$(OBJDIR):
mkdir -p $(OBJDIR)
clean:
rm -rf $(OBJDIR) $(NAME) $(NAME).rsrc
run: $(NAME)
./$(NAME)
# Unit tests for the parsing / timeline logic (no GUI, links libbe only).
TESTBIN = $(OBJDIR)/test_event
test: | $(OBJDIR)
$(CXX) $(CXXFLAGS) tests/test_event.cpp $(SRCDIR)/Event.cpp \
-o $(TESTBIN) -lbe -lroot
$(TESTBIN)
# Extract translatable strings (B_TRANSLATE) into locales/en.catkeys.
catkeys: | $(OBJDIR)
$(CXX) -E -P $(CXXFLAGS) -DB_COLLECTING_CATKEYS $(SRCS) > $(OBJDIR)/catkeys.pre
mkdir -p $(LOCALEDIR)
collectcatkeys -s $(APP_SIG) $(OBJDIR)/catkeys.pre -o $(LOCALEDIR)/en.catkeys
# Compile every locales/<lang>.catkeys into a binary <lang>.catalog. Install
# the results under ~/config/non-packaged/data/locale/catalogs/<signature>/.
catalogs:
@for f in $(LOCALEDIR)/*.catkeys; do \
lang=`basename $$f .catkeys`; \
echo "linkcatkeys $$f -> $(LOCALEDIR)/$$lang.catalog"; \
linkcatkeys -s $(APP_SIG) -l $$lang \
-o $(LOCALEDIR)/$$lang.catalog $$f; \
done
# Install the built catalogs for the current user so the app picks up the
# translation for the language selected in the Locale preferences. The Locale
# Kit looks up catalogs by the signature with the "application/" prefix
# stripped (e.g. .../catalogs/x-vnd.tesla-sentry-viewer/it.catalog).
CATALOG_SIG = $(patsubst application/%,%,$(APP_SIG))
CATALOGDIR = $(HOME)/config/non-packaged/data/locale/catalogs/$(CATALOG_SIG)
install-catalogs: catalogs
mkdir -p $(CATALOGDIR)
@for c in $(LOCALEDIR)/*.catalog; do \
lang=`basename $$c .catalog`; \
cp $$c $(CATALOGDIR)/$$lang.catalog; \
echo "installed $$lang.catalog"; \
done
.PHONY: all clean run test catkeys catalogs install-catalogs