-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
127 lines (107 loc) · 5 KB
/
Makefile
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
BUILDCONFIGURATION=Release
CWD=$(shell pwd)
ADIUM_FRAMEWORK_PATH=$(CWD)/Frameworks/adium
ADIUM_PATCHES=0001-Fix-Release-Debug-build.patch 0002-Reimport-libgcrypt-1.6.2-from-some-checkout-I-had-ly.patch
GLIB_FRAMEWORK_PATH=$(ADIUM_FRAMEWORK_PATH)/Frameworks/libglib.framework
GLIB_CFLAGS=$(addprefix -I,$(wildcard $(GLIB_FRAMEWORK_PATH)/Headers))
LIBPURPLE_FRAMEWORK_PATH=$(ADIUM_FRAMEWORK_PATH)/Frameworks/libpurple.framework
LIBPURPLE_CFLAGS=$(addprefix -I,$(wildcard $(LIBPURPLE_FRAMEWORK_PATH)/Headers))
LIBPURPLE_LDFLAGS=$(wildcard $(ADIUM_FRAMEWORK_PATH)/Frameworks/lib*.framework/lib*)
LIBGPGPERROR_FRAMEWORK_PATH=$(ADIUM_FRAMEWORK_PATH)/Frameworks/libgpgerror.framework
LIBGCRYPT_FRAMEWORK_PATH=$(ADIUM_FRAMEWORK_PATH)/Frameworks/libgcrypt.framework
LIBGCRYPT_CFLAGS=$(addprefix -I,$(wildcard $(LIBGCRYPT_FRAMEWORK_PATH)/Headers) \
$(wildcard $(LIBGPGPERROR_FRAMEWORK_PATH)/Headers))
LIBGCRYPT_LDFLAGS=$(wildcard $(LIBGCRYPT_FRAMEWORK_PATH)/lib*) \
$(wildcard $(LIBGPGPERROR_FRAMEWORK_PATH)/lib*)
MXML_PATH=$(CWD)/vendor/mxml
MXML_CFLAGS=$(addprefix -I,$(wildcard $(MXML_PATH)))
MXML_LDLAGS=$(addprefix -L,$(wildcard $(MXML_PATH)))
XCODEBUILD?=xcodebuild
all: build-l4a
prepare: prepare-vendor
build-adium:
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AIUtilities.framework/AIUtilities \
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/Adium.framework/AIUtilities \
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AdiumLibpurple.framework/AIUtilities
build-carbons: vendor/carbons/build/carbons.a
build-lurch: vendor/lurch/build/lurch.a
build-mxml: vendor/mxml/libmxml.a
build-l4a: build/$(BUILDCONFIGURATION)/Lurch4Adium.AdiumLibpurplePlugin
build/%/Lurch4Adium.AdiumLibpurplePlugin: Lurch4Adium.xcodeproj/project.pbxproj \
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AIUtilities.framework/AIUtilities \
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/Adium.framework/AIUtilities \
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AdiumLibpurple.framework/AIUtilities \
vendor/carbons/build/carbons.a \
vendor/lurch/build/lurch.a \
Lurch4Adium/Lurch4Adium.h \
Lurch4Adium/Lurch4Adium.m
$(XCODEBUILD) -project Lurch4Adium.xcodeproj -configuration $(BUILDCONFIGURATION) build
$(ADIUM_FRAMEWORK_PATH)/Makefile: prepare-vendor
vendor/lurch/Makefile: prepare-vendor
vendor/carbons/Makefile: prepare-vendor
prepare-vendor: vendor/.updated
vendor/.updated:
git submodule update --init --recursive
touch $@
Frameworks/:
mkdir -p $@
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AIUtilities.framework/AIUtilities: $(ADIUM_FRAMEWORK_PATH)/.built
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/Adium.framework/AIUtilities: $(ADIUM_FRAMEWORK_PATH)/.built
$(ADIUM_FRAMEWORK_PATH)/build/Release-Debug/AdiumLibpurple.framework/AIUtilities: $(ADIUM_FRAMEWORK_PATH)/.built
$(ADIUM_FRAMEWORK_PATH)/.patched: $(ADIUM_PATCHES) $(ADIUM_FRAMEWORK_PATH)/Makefile
cat $(ADIUM_PATCHES) | git -C $(ADIUM_FRAMEWORK_PATH)/ am
touch $@
$(ADIUM_FRAMEWORK_PATH)/.built: $(ADIUM_FRAMEWORK_PATH)/.patched
$(MAKE) -C $(ADIUM_FRAMEWORK_PATH) adium
touch $@
vendor/carbons/build/carbons.a: vendor/carbons/Makefile $(ADIUM_FRAMEWORK_PATH)/Frameworks/libpurple.framework/libpurple
$(MAKE) -C vendor/carbons \
"GLIB_CFLAGS=$(GLIB_CFLAGS)" \
"GLIB_LDFLAGS=$(GLIB_LDFLAGS)" \
"LIBPURPLE_CFLAGS=$(LIBPURPLE_CFLAGS) -DPURPLE_STATIC_PRPL" \
"LIBPURPLE_LDFLAGS=$(LIBPURPLE_LDFLAGS)" \
"XML2_CFLAGS=-I/usr/include/libxml2" \
"XML2_LDFLAGS=" \
LJABBER= \
build/carbons.a
vendor/lurch/build/lurch.a: vendor/lurch/Makefile $(ADIUM_FRAMEWORK_PATH)/Frameworks/libpurple.framework/libpurple vendor/mxml/libmxml.a
$(MAKE) -C vendor/lurch \
"GLIB_CFLAGS=$(GLIB_CFLAGS)" \
"GLIB_LDFLAGS=$(GLIB_LDFLAGS)" \
"LIBPURPLE_CFLAGS=$(LIBPURPLE_CFLAGS)" \
"LIBPURPLE_LDFLAGS=$(LIBPURPLE_LDFLAGS)" \
"LIBGCRYPT_CFLAGS=$(LIBGCRYPT_CFLAGS)" \
"LIBGCRYPT_LDFLAGS=$(LIBGCRYPT_LDFLAGS)" \
"MXML_CFLAGS=$(MXML_CFLAGS)" \
"MXML_LDFLAGS=$(MXML_LDFLAGS)" \
"XML2_CFLAGS=-I/usr/include/libxml2" \
"XML2_LDFLAGS=" \
LJABBER= \
build/lurch.a
vendor/mxml/libmxml.a: vendor/mxml/Makefile
$(MAKE) -C vendor/mxml libmxml.a
vendor/mxml/Makefile:
cd vendor/mxml; ./configure --disable-shared --disable-threads --disable-debug
clean: clean-adium clean-carbons clean-l4a clean-lurch clean-mxml
clean-adium:
test ! -e $(ADIUM_FRAMEWORK_PATH)/.built || $(MAKE) -C $(ADIUM_FRAMEWORK_PATH) clean
rm -f $(ADIUM_FRAMEWORK_PATH)/.built
test ! -e $(ADIUM_FRAMEWORK_PATH)/.patched || git -C $(ADIUM_FRAMEWORK_PATH)/ checkout HEAD~$(words $(ADIUM_PATCHES))
rm -f $(ADIUM_FRAMEWORK_PATH)/.patched
clean-carbons:
test ! -f vendor/carbons/Makefile || $(MAKE) -C vendor/carbons clean
clean-l4a:
rm -rf build/
clean-lurch:
test ! -f vendor/lurch/Makefile || $(MAKE) -C vendor/lurch clean-all
clean-mxml:
test ! -f vendor/mxml/Makefile || $(MAKE) -C vendor/mxml clean
real-clean: clean
git submodule deinit --all --force
rm -f vendor/.updated
.PHONY: all prepare prepare-vendor build clean real-clean \
build-adium clean-adium \
build-carbons clean-carbons \
build-l4a clean-l4a \
build-lurch clean-lurch \
build-mxml clean-mxml