2014-08-05 04:28:12 +02:00
|
|
|
TOXIC_VERSION = 0.4.7
|
2014-06-23 22:32:10 +02:00
|
|
|
REV = $(shell git rev-list HEAD --count)
|
|
|
|
VERSION = $(TOXIC_VERSION)_r$(REV)
|
|
|
|
|
2014-08-19 18:22:57 +02:00
|
|
|
BASE_DIR = $(shell cd .. && pwd -P)
|
|
|
|
CFG_DIR = $(BASE_DIR)/cfg
|
|
|
|
SRC_DIR = $(BASE_DIR)/src
|
2014-06-25 09:13:57 +02:00
|
|
|
PREFIX = /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
DATADIR = $(PREFIX)/share/toxic
|
2014-07-27 22:06:37 +02:00
|
|
|
MANDIR = $(PREFIX)/share/man
|
2014-06-25 09:13:57 +02:00
|
|
|
|
2014-07-21 12:33:19 +02:00
|
|
|
LIBS = libtoxcore ncursesw libconfig
|
2014-06-23 11:09:01 +02:00
|
|
|
|
2014-07-14 20:32:38 +02:00
|
|
|
CFLAGS = -std=gnu99 -pthread -Wall -g
|
2014-06-25 09:13:57 +02:00
|
|
|
CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
|
2014-06-26 14:06:22 +02:00
|
|
|
CFLAGS += -DPACKAGE_DATADIR="\"$(abspath $(DATADIR))\""
|
2014-06-24 17:35:23 +02:00
|
|
|
CFLAGS += $(USER_CFLAGS)
|
|
|
|
LDFLAGS = $(USER_LDFLAGS)
|
2014-06-23 11:09:01 +02:00
|
|
|
|
2014-07-21 12:33:19 +02:00
|
|
|
OBJ = chat.o chat_commands.o configdir.o dns.o execute.o file_senders.o notify.o
|
2014-07-18 07:29:46 +02:00
|
|
|
OBJ += friendlist.o global_commands.o groupchat.o line_info.o input.o help.o autocomplete.o
|
2014-06-23 11:09:01 +02:00
|
|
|
OBJ += log.o misc_tools.o prompt.o settings.o toxic.o toxic_strings.o windows.o
|
|
|
|
|
2014-06-24 00:17:14 +02:00
|
|
|
# Check on wich system we are running
|
2014-06-24 09:02:06 +02:00
|
|
|
UNAME_S = $(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S), Linux)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/systems/Linux.mk
|
2014-06-24 09:02:06 +02:00
|
|
|
endif
|
2014-07-06 21:23:58 +02:00
|
|
|
ifeq ($(UNAME_S), FreeBSD)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/systems/FreeBSD.mk
|
2014-07-06 21:23:58 +02:00
|
|
|
endif
|
2014-06-24 09:02:06 +02:00
|
|
|
ifeq ($(UNAME_S), Darwin)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/systems/Darwin.mk
|
2014-06-24 09:02:06 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_S), Solaris)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/systems/Solaris.mk
|
2014-06-24 09:02:06 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Check on which platform we are running
|
|
|
|
UNAME_M = $(shell uname -m)
|
|
|
|
ifeq ($(UNAME_M), x86_64)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/platforms/x86_64.mk
|
2014-06-24 09:02:06 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(filter %86, $(UNAME_M)),)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/platforms/x86.mk
|
2014-06-24 09:02:06 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(filter arm%, $(UNAME_M)),)
|
2014-07-30 14:14:13 +02:00
|
|
|
-include $(CFG_DIR)/platforms/arm.mk
|
2014-07-22 09:59:44 +02:00
|
|
|
endif
|
|
|
|
|
2014-07-30 14:14:13 +02:00
|
|
|
# Include all needed checks
|
2014-08-19 18:22:57 +02:00
|
|
|
-include $(CFG_DIR)/checks/check_features.mk
|
2014-06-23 11:09:01 +02:00
|
|
|
|
2014-06-24 00:17:14 +02:00
|
|
|
# Targets
|
2014-06-23 11:09:01 +02:00
|
|
|
all: toxic
|
|
|
|
|
|
|
|
toxic: $(OBJ)
|
2014-07-08 09:39:42 +02:00
|
|
|
@echo " LD $@"
|
|
|
|
@$(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS)
|
2014-06-23 11:09:01 +02:00
|
|
|
|
2014-06-24 11:53:02 +02:00
|
|
|
%.o: $(SRC_DIR)/%.c
|
2014-07-08 09:39:42 +02:00
|
|
|
@echo " CC $@"
|
|
|
|
@$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c
|
|
|
|
@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d
|
2014-06-23 11:09:01 +02:00
|
|
|
|
|
|
|
clean:
|
2014-06-24 11:01:32 +02:00
|
|
|
rm -rf *.d *.o toxic
|
2014-06-23 11:09:01 +02:00
|
|
|
|
2014-06-23 21:55:32 +02:00
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
|
2014-08-19 18:22:57 +02:00
|
|
|
-include $(CFG_DIR)/targets/*.mk
|
2014-07-30 14:14:13 +02:00
|
|
|
|
|
|
|
.PHONY: clean all
|