-
Notifications
You must be signed in to change notification settings - Fork 149
/
Makefile
118 lines (94 loc) · 4.08 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
## OPTIONS ##
# set to anything else to disable them
DBUS = 1
V4LCONVERT = 1
FILTER_AUDIO = 1
UNITY = 0
DEPS = fontconfig freetype2 libtoxav libtoxcore
DEPS += openal vpx x11 xext xrender
ifeq ($(DBUS), 1)
DEPS += dbus-1
endif
ifeq ($(V4LCONVERT), 1)
DEPS += libv4lconvert
endif
ifeq ($(FILTER_AUDIO), 1)
DEPS += filteraudio
endif
ifeq ($(UNITY), 1)
DEPS += messaging-menu unity
endif
UNAME_S := $(shell uname -s)
CFLAGS += -g -Wall -Wshadow -pthread -std=gnu99
CFLAGS += $(shell pkg-config --cflags $(DEPS))
LDFLAGS = -pthread -lm
LDFLAGS += $(shell pkg-config --libs $(DEPS))
ifneq ($(DBUS), 1)
CFLAGS += -DNO_DBUS
endif
ifneq ($(V4LCONVERT), 1)
CFLAGS += -DNO_V4LCONVERT
endif
ifeq ($(FILTER_AUDIO), 1)
CFLAGS += -DAUDIO_FILTERING
endif
ifeq ($(UNITY), 1)
CFLAGS += -DUNITY
endif
ifeq ($(UNAME_S), Linux)
LDFLAGS += -lresolv -ldl
endif
DESTDIR ?=
PREFIX ?= /usr/local
SRC = $(wildcard *.c png/png.c)
OBJ = $(SRC:.c=.o)
GIT_V = $(shell git describe --abbrev=8 --dirty --always --tags)
all: utox
utox: $(OBJ)
@echo " LD $@"
@$(CC) $(CFLAGS) -o utox $(OBJ) $(LDFLAGS)
install: utox
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 0755 utox $(DESTDIR)$(PREFIX)/bin/utox
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/14x14/apps
install -m 644 icons/utox-14x14.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/14x14/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps
install -m 644 icons/utox-16x16.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps
install -m 644 icons/utox-22x22.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
install -m 644 icons/utox-24x24.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps
install -m 644 icons/utox-32x32.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/36x36/apps
install -m 644 icons/utox-36x36.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/36x36/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
install -m 644 icons/utox-48x48.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps
install -m 644 icons/utox-64x64.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/72x72/apps
install -m 644 icons/utox-72x72.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/72x72/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/96x96/apps
install -m 644 icons/utox-96x96.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/96x96/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps
install -m 644 icons/utox-128x128.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/192x192/apps
install -m 644 icons/utox-192x192.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/192x192/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps
install -m 644 icons/utox-256x256.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/512x512/apps
install -m 644 icons/utox-512x512.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/512x512/apps/utox.png
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
install -m 644 icons/utox.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/utox.svg
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
install -m 644 utox.desktop $(DESTDIR)$(PREFIX)/share/applications/utox.desktop
if [ "$(UNITY)" -eq "1" ]; then echo "X-MessagingMenu-UsesChatSection=true" >> $(DESTDIR)$(PREFIX)/share/applications/utox.desktop; fi
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
install -m 644 utox.1 $(DESTDIR)$(PREFIX)/share/man/man1/utox.1
main.o: xlib/main.c xlib/keysym2ucs.c
.c.o:
@echo " CC $@"
@$(CC) $(CFLAGS) -o $@ -c -DGIT_VERSION=\"$(GIT_V)\" $<
clean:
rm -f utox *.o png/*.o
.PHONY: all clean