From a3a8f7608ae44799897b9f4d9e90c0c9be1e8421 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Tue, 19 Aug 2014 18:22:57 +0200 Subject: [PATCH] Fix Tox/toxic#222 and reorganize cfg dir --- build/Makefile | 10 +++++----- cfg/{ => checks}/av.mk | 0 cfg/{ => checks}/check_features.mk | 8 +++++--- cfg/{ => checks}/desktop_notifications.mk | 0 cfg/{ => checks}/sound_notifications.mk | 0 cfg/systems/FreeBSD.mk | 1 + cfg/systems/Linux.mk | 1 + cfg/{ => targets}/help.mk | 0 cfg/{ => targets}/install.mk | 6 +++--- 9 files changed, 15 insertions(+), 11 deletions(-) rename cfg/{ => checks}/av.mk (100%) rename cfg/{ => checks}/check_features.mk (89%) rename cfg/{ => checks}/desktop_notifications.mk (100%) rename cfg/{ => checks}/sound_notifications.mk (100%) rename cfg/{ => targets}/help.mk (100%) rename cfg/{ => targets}/install.mk (94%) diff --git a/build/Makefile b/build/Makefile index ba0930f..4c85d7d 100644 --- a/build/Makefile +++ b/build/Makefile @@ -2,8 +2,9 @@ TOXIC_VERSION = 0.4.7 REV = $(shell git rev-list HEAD --count) VERSION = $(TOXIC_VERSION)_r$(REV) -CFG_DIR = ../cfg -SRC_DIR = ../src +BASE_DIR = $(shell cd .. && pwd -P) +CFG_DIR = $(BASE_DIR)/cfg +SRC_DIR = $(BASE_DIR)/src PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic @@ -49,7 +50,7 @@ ifneq ($(filter arm%, $(UNAME_M)),) endif # Include all needed checks --include $(CFG_DIR)/check_features.mk +-include $(CFG_DIR)/checks/check_features.mk # Targets all: toxic @@ -68,7 +69,6 @@ clean: -include $(OBJ:.o=.d) --include $(CFG_DIR)/install.mk --include $(CFG_DIR)/help.mk +-include $(CFG_DIR)/targets/*.mk .PHONY: clean all diff --git a/cfg/av.mk b/cfg/checks/av.mk similarity index 100% rename from cfg/av.mk rename to cfg/checks/av.mk diff --git a/cfg/check_features.mk b/cfg/checks/check_features.mk similarity index 89% rename from cfg/check_features.mk rename to cfg/checks/check_features.mk index 56d2210..fd1c549 100644 --- a/cfg/check_features.mk +++ b/cfg/checks/check_features.mk @@ -1,3 +1,5 @@ +CHECKS_DIR = $(CFG_DIR)/checks + # Check if we can use X11 CHECK_X11_LIBS = $(shell pkg-config x11 || echo -n "error") ifneq ($(CHECK_X11_LIBS), error) @@ -8,19 +10,19 @@ endif # Check if we want build audio support AUDIO = $(shell if [ -z "$(DISABLE_AV)" ] || [ "$(DISABLE_AV)" = "0" ] ; then echo enabled ; else echo disabled ; fi) ifneq ($(AUDIO), disabled) - -include $(CFG_DIR)/av.mk + -include $(CHECKS_DIR)/av.mk endif # Check if we want build sound notifications support SND_NOTIFY = $(shell if [ -z "$(DISABLE_SOUND_NOTIFY)" ] || [ "$(DISABLE_SOUND_NOTIFY)" = "0" ] ; then echo enabled ; else echo disabled ; fi) ifneq ($(SND_NOTIFY), disabled) - -include $(CFG_DIR)/sound_notifications.mk + -include $(CHECKS_DIR)/sound_notifications.mk endif # Check if we want build desktop notifications support DESK_NOTIFY = $(shell if [ -z "$(DISABLE_DESKTOP_NOTIFY)" ] || [ "$(DISABLE_DESKTOP_NOTIFY)" = "0" ] ; then echo enabled ; else echo disabled ; fi) ifneq ($(DESK_NOTIFY), disabled) - -include $(CFG_DIR)/desktop_notifications.mk + -include $(CHECKS_DIR)/desktop_notifications.mk endif # Check if we can build Toxic diff --git a/cfg/desktop_notifications.mk b/cfg/checks/desktop_notifications.mk similarity index 100% rename from cfg/desktop_notifications.mk rename to cfg/checks/desktop_notifications.mk diff --git a/cfg/sound_notifications.mk b/cfg/checks/sound_notifications.mk similarity index 100% rename from cfg/sound_notifications.mk rename to cfg/checks/sound_notifications.mk diff --git a/cfg/systems/FreeBSD.mk b/cfg/systems/FreeBSD.mk index a4c1e43..1ae75e8 100644 --- a/cfg/systems/FreeBSD.mk +++ b/cfg/systems/FreeBSD.mk @@ -1,3 +1,4 @@ # Specials options for freebsd systems LIBS := $(filter-out ncursesw, $(LIBS)) LDFLAGS += -lncursesw +MANDIR = $(PREFIX)/man diff --git a/cfg/systems/Linux.mk b/cfg/systems/Linux.mk index e77fe25..c8bf512 100644 --- a/cfg/systems/Linux.mk +++ b/cfg/systems/Linux.mk @@ -1,3 +1,4 @@ # Specials options for linux systems CFLAGS += LDFLAGS += -ldl -lresolv +MANDIR = $(PREFIX)/share/man diff --git a/cfg/help.mk b/cfg/targets/help.mk similarity index 100% rename from cfg/help.mk rename to cfg/targets/help.mk diff --git a/cfg/install.mk b/cfg/targets/install.mk similarity index 94% rename from cfg/install.mk rename to cfg/targets/install.mk index 9cf266d..2e12dcd 100644 --- a/cfg/install.mk +++ b/cfg/targets/install.mk @@ -1,6 +1,6 @@ -MISC_DIR = ../misc -DOC_DIR = ../doc -SND_DIR = ../sounds +MISC_DIR = $(BASE_DIR)/misc +DOC_DIR = $(BASE_DIR)/doc +SND_DIR = $(BASE_DIR)/sounds DATAFILES = DHTnodes DNSservers toxic.conf.example MANFILES = toxic.1 toxic.conf.5 SNDFILES = ContactLogsIn.wav ContactLogsOut.wav Error.wav IncomingCall.wav