forked from loskutov/deadbeef-lyricbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (30 loc) · 1.11 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
CFLAGS+=-std=c99 -Wall -O2 -D_GNU_SOURCE -fPIC -fvisibility=hidden -flto
CXXFLAGS+=-std=c++14 -Wall -O2 -fPIC -fvisibility=hidden -flto
LIBFLAGS=`pkg-config --cflags libxml++-3.0 $(GTKMM) $(GTK)`
LIBS=`pkg-config --libs libxml++-3.0 $(GTKMM) $(GTK)`
prefix ?= $(out)
prefix ?= /usr
gtk3: GTKMM=gtkmm-3.0
gtk3: GTK=gtk+-3.0
gtk3: LYRICBAR=ddb_lyricbar_gtk3.so
gtk3: lyricbar
gtk2: GTKMM=gtkmm-2.4
gtk2: GTK=gtk+-2.0
gtk2: LYRICBAR=ddb_lyricbar_gtk2.so
gtk2: lyricbar
lyricbar: ui.o utils.o main.o
$(if $(LYRICBAR),, $(error You should only access this target via "gtk3" or "gtk2"))
$(CXX) -flto -shared main.o ui.o utils.o -o $(LYRICBAR) $(LIBS)
ui.o: src/ui.cpp
$(CXX) src/ui.cpp -c $(LIBFLAGS) $(CXXFLAGS)
utils.o: src/utils.cpp
$(CXX) src/utils.cpp -c $(LIBFLAGS) $(CXXFLAGS)
main.o: src/main.c
$(CC) $(CFLAGS) src/main.c -c `pkg-config --cflags $(GTK)`
install:
install -d $(prefix)/lib/deadbeef
install -d $(prefix)/share/locale/ru/LC_MESSAGES
install -m 666 -D *.so $(prefix)/lib/deadbeef
msgfmt gettext/ru/deadbeef-lyricbar.po -o $(prefix)/share/locale/ru/LC_MESSAGES/deadbeef-lyricbar.mo
clean:
rm -f *.o *.so