mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 20:23:01 +01:00
Makefile fix
This commit is contained in:
parent
7abd8d5ee5
commit
98aae242fb
@ -5,7 +5,7 @@ compiler:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Installing yasm (needed for compiling vpx) and openal
|
# Installing yasm (needed for compiling vpx) and openal
|
||||||
- sudo apt-get -yq install yasm libopenal-dev
|
- sudo apt-get -yq install yasm libopenal-dev libconfig-dev
|
||||||
# Installing libsodium, needed for toxcore
|
# Installing libsodium, needed for toxcore
|
||||||
- git clone https://github.com/jedisct1/libsodium.git libsodium
|
- git clone https://github.com/jedisct1/libsodium.git libsodium
|
||||||
- cd libsodium
|
- cd libsodium
|
||||||
|
@ -6,14 +6,18 @@ CFG_DIR = ../cfg
|
|||||||
SRC_DIR = ../src
|
SRC_DIR = ../src
|
||||||
MISC_DIR = ../misc
|
MISC_DIR = ../misc
|
||||||
DOC_DIR = ../doc
|
DOC_DIR = ../doc
|
||||||
|
SND_DIR = ../sounds
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
DATADIR = $(PREFIX)/share/toxic
|
DATADIR = $(PREFIX)/share/toxic
|
||||||
MANDIR = $(PREFIX)/man
|
MANDIR = $(PREFIX)/man
|
||||||
DATAFILES = DHTnodes toxic.conf.example
|
DATAFILES = DHTnodes toxic.conf.example
|
||||||
MANFILES = toxic.1 toxic.conf.5
|
MANFILES = toxic.1 toxic.conf.5
|
||||||
|
SNDFILES = ContactLogsIn.wav ContactLogsOut.wav Error.wav IncomingCall.wav
|
||||||
|
SNDFILES += LogIn.wav LogOut.wav NewMessage.wav OutgoingCall.wav
|
||||||
|
SNDFILES += TransferComplete.wav TransferPending.wav
|
||||||
|
|
||||||
LIBS = libtoxcore ncursesw
|
LIBS = libtoxcore ncursesw libconfig
|
||||||
|
|
||||||
CFLAGS = -std=gnu99 -pthread -Wall -g
|
CFLAGS = -std=gnu99 -pthread -Wall -g
|
||||||
CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
|
CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
|
||||||
@ -21,15 +25,20 @@ CFLAGS += -DPACKAGE_DATADIR="\"$(abspath $(DATADIR))\""
|
|||||||
CFLAGS += $(USER_CFLAGS)
|
CFLAGS += $(USER_CFLAGS)
|
||||||
LDFLAGS = $(USER_LDFLAGS)
|
LDFLAGS = $(USER_LDFLAGS)
|
||||||
|
|
||||||
OBJ = chat.o chat_commands.o configdir.o dns.o execute.o file_senders.o
|
OBJ = chat.o chat_commands.o configdir.o dns.o execute.o file_senders.o notify.o
|
||||||
OBJ += friendlist.o global_commands.o groupchat.o line_info.o input.o help.o autocomplete.o
|
OBJ += friendlist.o global_commands.o groupchat.o line_info.o input.o help.o autocomplete.o
|
||||||
OBJ += log.o misc_tools.o prompt.o settings.o toxic.o toxic_strings.o windows.o
|
OBJ += log.o misc_tools.o prompt.o settings.o toxic.o toxic_strings.o windows.o
|
||||||
|
|
||||||
# Variables for audio support
|
# Variables for audio support
|
||||||
AUDIO_LIBS = libtoxav openal
|
AUDIO_LIBS = libtoxav openal
|
||||||
AUDIO_CFLAGS = -D_SUPPORT_AUDIO
|
AUDIO_CFLAGS = -D_AUDIO
|
||||||
AUDIO_OBJ = device.o audio_call.o
|
AUDIO_OBJ = device.o audio_call.o
|
||||||
|
|
||||||
|
# Variables for sound notify support
|
||||||
|
SND_NOTIFY_LIBS = openal freealut
|
||||||
|
SND_NOTIFY_CFLAGS = -D_SOUND_NOTIFY
|
||||||
|
SND_NOTIFY_OBJ = device.o
|
||||||
|
|
||||||
# Check on wich system we are running
|
# Check on wich system we are running
|
||||||
UNAME_S = $(shell uname -s)
|
UNAME_S = $(shell uname -s)
|
||||||
ifeq ($(UNAME_S), Linux)
|
ifeq ($(UNAME_S), Linux)
|
||||||
@ -57,6 +66,13 @@ ifneq ($(filter arm%, $(UNAME_M)),)
|
|||||||
-include $(CFG_DIR)/arm.mk
|
-include $(CFG_DIR)/arm.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Check if we can use X11
|
||||||
|
CHECK_X11_LIBS = $(shell pkg-config x11 || echo -n "error")
|
||||||
|
ifneq ($(CHECK_X11_LIBS), error)
|
||||||
|
LIBS += x11
|
||||||
|
CFLAGS += -D_X11
|
||||||
|
endif
|
||||||
|
|
||||||
# Check if we want/can build audio
|
# Check if we want/can build audio
|
||||||
ifneq ($(DISABLE_AV), 1)
|
ifneq ($(DISABLE_AV), 1)
|
||||||
CHECK_AUDIO_LIBS = $(shell pkg-config $(AUDIO_LIBS) || echo -n "error")
|
CHECK_AUDIO_LIBS = $(shell pkg-config $(AUDIO_LIBS) || echo -n "error")
|
||||||
@ -74,6 +90,23 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Check if we want/can build sound notify support
|
||||||
|
ifneq ($(DISABLE_NOTIFY), 1)
|
||||||
|
CHECK_NOTIFY_LIBS = $(shell pkg-config $(SND_NOTIFY_LIBS) || echo -n "error")
|
||||||
|
ifneq ($(CHECK_NOTIFY_LIBS), error)
|
||||||
|
LIBS += $(SND_NOTIFY_LIBS)
|
||||||
|
CFLAGS += $(SND_NOTIFY_CFLAGS)
|
||||||
|
OBJ += $(SND_NOTIFY_OBJ)
|
||||||
|
else
|
||||||
|
ifneq ($(MAKECMDGOALS), clean)
|
||||||
|
MISSING_NOTIFY_LIBS = $(shell for lib in $(SND_NOTIFY_LIBS) ; do if ! pkg-config $$lib ; then echo $$lib ; fi ; done)
|
||||||
|
$(warning WARNING -- Toxic will be compiled without sound notify support)
|
||||||
|
$(warning WARNING -- You need these libraries for sound notify support)
|
||||||
|
$(warning WARNING -- $(MISSING_NOTIFY_LIBS))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Check if we can build Toxic
|
# Check if we can build Toxic
|
||||||
CHECK_LIBS = $(shell pkg-config $(LIBS) || echo -n "error")
|
CHECK_LIBS = $(shell pkg-config $(LIBS) || echo -n "error")
|
||||||
ifneq ($(CHECK_LIBS), error)
|
ifneq ($(CHECK_LIBS), error)
|
||||||
@ -99,12 +132,18 @@ toxic: $(OBJ)
|
|||||||
install: toxic
|
install: toxic
|
||||||
mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
|
mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
|
||||||
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
|
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
|
||||||
|
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds
|
||||||
mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
|
mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
|
||||||
@echo "Installing toxic executable"
|
@echo "Installing toxic executable"
|
||||||
@install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR))
|
@install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR))
|
||||||
@echo "Installing data files"
|
@echo "Installing data files"
|
||||||
@for f in $(DATAFILES) ; do \
|
@for f in $(DATAFILES) ; do \
|
||||||
install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)) ;\
|
install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)) ;\
|
||||||
|
file=$(abspath $(DESTDIR)/$(DATADIR))/$$f ;\
|
||||||
|
sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\
|
||||||
|
done
|
||||||
|
@for f in $(SNDFILES) ; do \
|
||||||
|
install -m 0644 $(SND_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR))/sounds ;\
|
||||||
done
|
done
|
||||||
@echo "Installing man pages"
|
@echo "Installing man pages"
|
||||||
@for f in $(MANFILES) ; do \
|
@for f in $(MANFILES) ; do \
|
||||||
|
@ -9,6 +9,7 @@ help:
|
|||||||
@echo
|
@echo
|
||||||
@echo "-- Variables --"
|
@echo "-- Variables --"
|
||||||
@echo " DISABLE_AV: Set to \"1\" to force building without audio call support"
|
@echo " DISABLE_AV: Set to \"1\" to force building without audio call support"
|
||||||
|
@echo " DISABLE_NOTIFY: Set to \"1\" to force building without sound notify support"
|
||||||
@echo " USER_CFLAGS: Add custom flags to default CFLAGS"
|
@echo " USER_CFLAGS: Add custom flags to default CFLAGS"
|
||||||
@echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
|
@echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
|
||||||
@echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
|
@echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
|
||||||
|
@ -38,14 +38,14 @@ tox = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sounds = {
|
sounds = {
|
||||||
error="/usr/local/toxic/sounds/Error.wav";
|
error="__DATADIR__/sounds/Error.wav";
|
||||||
self_log_in="/usr/local/toxic/sounds/Log In.wav";
|
self_log_in="__DATADIR__/sounds/LogIn.wav";
|
||||||
self_log_out="/usr/local/toxic/sounds/Log Out.wav";
|
self_log_out="__DATADIR__/sounds/LogOut.wav";
|
||||||
user_log_in="/usr/local/toxic/sounds/Contact Logs In.wav";
|
user_log_in="__DATADIR__/sounds/ContactLogsIn.wav";
|
||||||
user_log_out="/usr/local/toxic/sounds/Contact Logs Out.wav";
|
user_log_out="__DATADIR__/sounds/ContactLogsOut.wav";
|
||||||
call_incoming="/usr/local/toxic/sounds/Incoming Call.wav";
|
call_incoming="__DATADIR__/sounds/IncomingCall.wav";
|
||||||
call_outgoing="/usr/local/toxic/sounds/Outgoing Call.wav";
|
call_outgoing="__DATADIR__/sounds/OutgoingCall.wav";
|
||||||
generic_message="/usr/local/toxic/sounds/New Message.wav";
|
generic_message="__DATADIR__/sounds/NewMessage.wav";
|
||||||
transfer_pending="/usr/local/toxic/sounds/Transfer Pending.wav";
|
transfer_pending="__DATADIR__/sounds/TransferPending.wav";
|
||||||
transfer_completed="/usr/local/toxic/sounds/Transfer Complete.wav";
|
transfer_completed="__DATADIR__/sounds/TransferComplete.wav";
|
||||||
};
|
};
|
0
sounds/Contact Logs In.wav → sounds/ContactLogsIn.wav
Executable file → Normal file
0
sounds/Contact Logs In.wav → sounds/ContactLogsIn.wav
Executable file → Normal file
0
sounds/Contact Logs Out.wav → sounds/ContactLogsOut.wav
Executable file → Normal file
0
sounds/Contact Logs Out.wav → sounds/ContactLogsOut.wav
Executable file → Normal file
0
sounds/Error.wav
Executable file → Normal file
0
sounds/Error.wav
Executable file → Normal file
0
sounds/Incoming Call.wav → sounds/IncomingCall.wav
Executable file → Normal file
0
sounds/Incoming Call.wav → sounds/IncomingCall.wav
Executable file → Normal file
0
sounds/Log In.wav → sounds/LogIn.wav
Executable file → Normal file
0
sounds/Log In.wav → sounds/LogIn.wav
Executable file → Normal file
0
sounds/Log Out.wav → sounds/LogOut.wav
Executable file → Normal file
0
sounds/Log Out.wav → sounds/LogOut.wav
Executable file → Normal file
0
sounds/New Message.wav → sounds/NewMessage.wav
Executable file → Normal file
0
sounds/New Message.wav → sounds/NewMessage.wav
Executable file → Normal file
0
sounds/Outgoing Call.wav → sounds/OutgoingCall.wav
Executable file → Normal file
0
sounds/Outgoing Call.wav → sounds/OutgoingCall.wav
Executable file → Normal file
0
sounds/Transfer Complete.wav → sounds/TransferComplete.wav
Executable file → Normal file
0
sounds/Transfer Complete.wav → sounds/TransferComplete.wav
Executable file → Normal file
0
sounds/Transfer Pending.wav → sounds/TransferPending.wav
Executable file → Normal file
0
sounds/Transfer Pending.wav → sounds/TransferPending.wav
Executable file → Normal file
Loading…
Reference in New Issue
Block a user