1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-16 02:53:03 +01:00

Makefile fix

This commit is contained in:
Ansa89 2014-07-21 12:33:19 +02:00
parent 7abd8d5ee5
commit 98aae242fb
14 changed files with 60 additions and 20 deletions

View File

@ -5,7 +5,7 @@ compiler:
before_script:
# 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
- git clone https://github.com/jedisct1/libsodium.git libsodium
- cd libsodium

View File

@ -6,14 +6,18 @@ CFG_DIR = ../cfg
SRC_DIR = ../src
MISC_DIR = ../misc
DOC_DIR = ../doc
SND_DIR = ../sounds
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/toxic
MANDIR = $(PREFIX)/man
DATAFILES = DHTnodes toxic.conf.example
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 += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
@ -21,15 +25,20 @@ CFLAGS += -DPACKAGE_DATADIR="\"$(abspath $(DATADIR))\""
CFLAGS += $(USER_CFLAGS)
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 += log.o misc_tools.o prompt.o settings.o toxic.o toxic_strings.o windows.o
# Variables for audio support
AUDIO_LIBS = libtoxav openal
AUDIO_CFLAGS = -D_SUPPORT_AUDIO
AUDIO_CFLAGS = -D_AUDIO
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
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S), Linux)
@ -57,6 +66,13 @@ ifneq ($(filter arm%, $(UNAME_M)),)
-include $(CFG_DIR)/arm.mk
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
ifneq ($(DISABLE_AV), 1)
CHECK_AUDIO_LIBS = $(shell pkg-config $(AUDIO_LIBS) || echo -n "error")
@ -74,6 +90,23 @@ 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_LIBS = $(shell pkg-config $(LIBS) || echo -n "error")
ifneq ($(CHECK_LIBS), error)
@ -99,12 +132,18 @@ toxic: $(OBJ)
install: toxic
mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds
mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
@echo "Installing toxic executable"
@install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR))
@echo "Installing data files"
@for f in $(DATAFILES) ; do \
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
@echo "Installing man pages"
@for f in $(MANFILES) ; do \

View File

@ -8,10 +8,11 @@ help:
@echo " help: This help"
@echo
@echo "-- Variables --"
@echo " DISABLE_AV: Set to \"1\" to force building without audio call support"
@echo " USER_CFLAGS: Add custom flags to default CFLAGS"
@echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
@echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
@echo " DESTDIR: Specify a directory where to store installed files (mainly for packaging purpose)"
@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_LDFLAGS: Add custom flags to default LDFLAGS"
@echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
@echo " DESTDIR: Specify a directory where to store installed files (mainly for packaging purpose)"
.PHONY: help

View File

@ -38,14 +38,14 @@ tox = {
};
sounds = {
error="/usr/local/toxic/sounds/Error.wav";
self_log_in="/usr/local/toxic/sounds/Log In.wav";
self_log_out="/usr/local/toxic/sounds/Log Out.wav";
user_log_in="/usr/local/toxic/sounds/Contact Logs In.wav";
user_log_out="/usr/local/toxic/sounds/Contact Logs Out.wav";
call_incoming="/usr/local/toxic/sounds/Incoming Call.wav";
call_outgoing="/usr/local/toxic/sounds/Outgoing Call.wav";
generic_message="/usr/local/toxic/sounds/New Message.wav";
transfer_pending="/usr/local/toxic/sounds/Transfer Pending.wav";
transfer_completed="/usr/local/toxic/sounds/Transfer Complete.wav";
};
error="__DATADIR__/sounds/Error.wav";
self_log_in="__DATADIR__/sounds/LogIn.wav";
self_log_out="__DATADIR__/sounds/LogOut.wav";
user_log_in="__DATADIR__/sounds/ContactLogsIn.wav";
user_log_out="__DATADIR__/sounds/ContactLogsOut.wav";
call_incoming="__DATADIR__/sounds/IncomingCall.wav";
call_outgoing="__DATADIR__/sounds/OutgoingCall.wav";
generic_message="__DATADIR__/sounds/NewMessage.wav";
transfer_pending="__DATADIR__/sounds/TransferPending.wav";
transfer_completed="__DATADIR__/sounds/TransferComplete.wav";
};

View File

View File

0
sounds/Error.wav Executable file → Normal file
View File

0
sounds/Incoming Call.wav → sounds/IncomingCall.wav Executable file → Normal file
View File

0
sounds/Log In.wav → sounds/LogIn.wav Executable file → Normal file
View File

0
sounds/Log Out.wav → sounds/LogOut.wav Executable file → Normal file
View File

0
sounds/New Message.wav → sounds/NewMessage.wav Executable file → Normal file
View File

0
sounds/Outgoing Call.wav → sounds/OutgoingCall.wav Executable file → Normal file
View File

View File

View File