-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
63 lines (54 loc) · 2.24 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
62
63
DESTDIR=/
LIBDIR=/lib
DISTRO=debian
SHELL=bash -e
build: clean lsl buildmo
lsl:
mkdir -p build
$(CC) -o build/liblsl.so $(wildcard src/*.c) \
-fno-plt -O3 -s -fvisibility=hidden -Isrc -shared \
-fPIC -g3 -Wall -Wextra -Werror -Wno-unused-result \
-nostdlib -lc $(CFLAGS)
$(CC) -o build/lsl src/cli/lsl.c -Lbuild -llsl \
-fno-plt -O3 -s -fvisibility=hidden -Isrc -g3 \
-Wall -Wextra -Werror $(CFLAGS)
$(CC) -o build/lsl-sandbox src/cli/lsl-sandbox.c -Lbuild -llsl \
-fno-plt -O3 -s -fvisibility=hidden -Isrc -g3 \
-Wall -Wextra -Werror $(CFLAGS)
$(CC) -o build/test src/cli/test.c $(wildcard src/*.c) -Isrc -g3 -Wall -Wextra -Werror
clean:
rm -rf build
rm -f po/*.mo
install: install_lsl install_data install_distro installmo
install_data:
install -Dm644 data/subsystem.menu $(DESTDIR)/etc/xdg/menus/
install -Dm644 data/subsystem.directory $(DESTDIR)/usr/share/desktop-directories/
install -Dm755 data/lsl.env $(DESTDIR)/etc/profile.d/lsl.sh
install -Dm755 data/bash-completion.sh $(DESTDIR)/usr/share/bash-completion/completions/lsl
if [ -d /var/lib/dpkg/info ] ; then \
install -Dm755 data/lsl.xinit $(DESTDIR)/etc/X11/Xsession.d/91-lsl ;\
else \
install -Dm755 data/lsl.xinit $(DESTDIR)/etc/X11/xinit/xinitrc.d/91-lsl ;\
fi
install_lsl:
install -Dm755 build/lsl $(DESTDIR)/bin/lsl
install -Dm755 build/lsl-sandbox $(DESTDIR)/bin/lsl-sandbox
install -Dm755 build/liblsl.so $(DESTDIR)/$(LIBDIR)
chmod u+s $(DESTDIR)/bin/lsl || true
chmod u+s $(DESTDIR)/bin/lsl-sandbox || true
install_distro:
install -Dm644 distro/$(DISTRO)/subsystem-init.sh $(DESTDIR)/usr/libexec/
install -Dm644 distro/$(DISTRO)/logo.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/subsystem-$(DISTRO).svg
install -Dm755 distro/$(DISTRO)/lsl.desktop $(DESTDIR)/usr/share/applications/
install -Dm755 distro/$(DISTRO)/lsl-root.desktop $(DESTDIR)/usr/share/applications/
buildmo:
@echo "Building the mo files"
for file in `ls po/*.po`; do \
lang=`echo $$file | sed 's@po/@@' | sed 's/\.po//'`; \
msgfmt -o po/$$lang.mo $$file; \
done
installmo:
for file in `ls po/*.po`; do \
lang=`echo $$file | sed 's@po/@@' | sed 's/\.po//'`; \
install -Dm644 po/$$lang.mo $(DESTDIR)/usr/share/locale/$$lang/LC_MESSAGES/lsl.mo ;\
done