summaryrefslogtreecommitdiffstats
blob: b93c85fb407af5272d72e9486419935183fbfca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
include Makefile.config

CXXFLAGS += -I$(PWD)
CFLAGS += -I$(PWD)
ARFLAGS = rcs

.DEFAULT_GOAL = all

################################################################################
# Echoing
################################################################################

ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
ifeq ($(C),0)
QUIET_MM   = @echo "    " "MM  " $@;
QUIET_CC   = @echo "    " "CC  " $@;
QUIET_CXX  = @echo "    " "CXX " $@;
QUIET_AR   = @echo "    " "AR  " $@;
QUIET_LINK = @echo "    " "LINK" $@;
QUIET_NIB  = @echo "    " "NIB " $@;
else
QUIET_MM   = @echo "    $(shell tput setaf 5)MM$(shell tput sgr0)  " $@;
QUIET_CC   = @echo "    $(shell tput setaf 3)CC$(shell tput sgr0)  " $@;
QUIET_CXX  = @echo "    $(shell tput setaf 2)CXX$(shell tput sgr0) " $@;
QUIET_AR   = @echo "    $(shell tput setaf 1)AR$(shell tput sgr0)  " $@;
QUIET_LINK = @echo "    $(shell tput setaf 6)LINK$(shell tput sgr0)" $@;
QUIET_NIB  = @echo "    $(shell tput setaf 4)NIB$(shell tput sgr0) " $@;
endif
endif
endif

################################################################################
# Modules
################################################################################

include 3rdParty/Boost/Makefile.inc
include 3rdParty/CppUnit/Makefile.inc
include 3rdParty/LibIDN/Makefile.inc
include 3rdParty/ZLib/Makefile.inc
include 3rdParty/Expat/Makefile.inc
include 3rdParty/SQLite/Makefile.inc
include Swiften/Makefile.inc
ifeq ($(BUILD_SWIFT),yes)
include Swift/Makefile.inc
endif
ifeq ($(BUILD_LIMBER),yes)
include Limber/Makefile.inc
endif
ifeq ($(BUILD_SLIMBER),yes)
include Slimber/Makefile.inc
endif
include QA/Makefile.inc
################################################################################
# Main targets
################################################################################

.PHONY: all
all: $(TARGETS)

.PHONY: install
install: $(INSTALL_TARGETS)

.PHONY: coverage
coverage:
	tools/coverage/GenerateCoverageResults.sh

.PHONY: clean
clean: $(CLEAN_TARGETS)
	-rm -rf $(CLEANFILES)
	-find . \( -name "*.dep" -or -name "*.a" -or -name "*.o" -or -name "*.obj" -or -name "*.gcda" -or -name "*.gcno" -or -name "*.gcov" \) -exec rm {} \;

################################################################################
# Automatic dependency detection
################################################################################

ifeq (,$(findstring clean, $(MAKECMDGOALS)))
ifeq (,$(findstring clean-deps, $(MAKECMDGOALS)))
-include $(DEPS)
endif
endif

%/PkgInfo:
	printf "APPL\77\77\77\77" > $@

%.dep: %.cpp
	$(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@

%.dep: %.c
	$(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CFLAGS)) $< > $@

%.dep: %.mm
	$(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@

%.dep: %.m
	$(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CFLAGS)) $< > $@

%.o: %.c
	$(QUIET_CC)$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)

%.o: %.cpp
	$(QUIET_CXX)$(CXX) -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)

%.o: %.mm
	$(QUIET_CXX)$(CXX) -x objective-c++ -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)

%.o: %.m
	$(QUIET_CC)$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)

%.nib: %.xib
	$(QUIET_NIB)/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile $@ $<