1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-30 08:43:27 +01:00
toxic/build/Makefile

69 lines
1.7 KiB
Makefile
Raw Normal View History

BASE_DIR = $(shell cd .. && pwd -P)
CFG_DIR = $(BASE_DIR)/cfg
2014-06-25 09:13:57 +02:00
2014-08-25 12:54:44 +02:00
-include $(CFG_DIR)/global_vars.mk
2014-07-21 12:33:19 +02:00
LIBS = libtoxcore ncursesw libconfig
CFLAGS = -std=gnu99 -pthread -Wall -g
2014-09-24 20:23:08 +02:00
CFLAGS += '-DTOXICVER="$(VERSION)"' -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64
CFLAGS += '-DPACKAGE_DATADIR="$(abspath $(DATADIR))"'
CFLAGS += $(USER_CFLAGS)
LDFLAGS = $(USER_LDFLAGS)
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
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 message_queue.o
2014-11-15 04:15:59 +01:00
OBJ += group_commands.o
# Check on wich system we are running
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S), Linux)
-include $(CFG_DIR)/systems/Linux.mk
endif
2014-07-06 21:23:58 +02:00
ifeq ($(UNAME_S), FreeBSD)
-include $(CFG_DIR)/systems/FreeBSD.mk
2014-07-06 21:23:58 +02:00
endif
ifeq ($(UNAME_S), Darwin)
-include $(CFG_DIR)/systems/Darwin.mk
endif
ifeq ($(UNAME_S), Solaris)
-include $(CFG_DIR)/systems/Solaris.mk
endif
# Check on which platform we are running
UNAME_M = $(shell uname -m)
ifeq ($(UNAME_M), x86_64)
-include $(CFG_DIR)/platforms/x86_64.mk
endif
ifneq ($(filter %86, $(UNAME_M)),)
-include $(CFG_DIR)/platforms/x86.mk
endif
ifneq ($(filter arm%, $(UNAME_M)),)
-include $(CFG_DIR)/platforms/arm.mk
2014-07-22 09:59:44 +02:00
endif
# Include all needed checks
-include $(CFG_DIR)/checks/check_features.mk
# Targets
all: toxic
toxic: $(OBJ)
2014-07-08 09:39:42 +02:00
@echo " LD $@"
2014-09-19 10:47:25 +02:00
@$(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS)
2014-06-24 11:53:02 +02:00
%.o: $(SRC_DIR)/%.c
2014-07-08 09:39:42 +02:00
@echo " CC $@"
2014-09-19 10:47:25 +02:00
@$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c
2014-07-08 09:39:42 +02:00
@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d
clean:
2014-09-23 00:45:45 +02:00
rm -f *.d *.o toxic
2014-06-23 21:55:32 +02:00
-include $(OBJ:.o=.d)
-include $(CFG_DIR)/targets/*.mk
2014-08-25 12:54:44 +02:00
.PHONY: clean all