This repository was archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.mingw
More file actions
97 lines (75 loc) · 2.92 KB
/
Copy pathMakefile.mingw
File metadata and controls
97 lines (75 loc) · 2.92 KB
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
PLUGIN = pidgin-master-password
PLUGIN_TOP := .
-include $(PLUGIN_TOP)/local.mak
PIDGIN_TREE_TOP ?= ../../..
include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
SODIUM_TOP=$(WIN32_DEV_TOP)/libsodium-1.0.18-mingw/libsodium-win32
PLUGIN_VERSION := $(shell ./scripts/gen-version.sh)
PLUGIN_WIN32_ZIP := $(PLUGIN)-$(PLUGIN_VERSION)-win32.zip
SRC=$(wildcard src/*.c)
OBJ=$(SRC:%.c=%.o)
DEP=$(SRC:%.c=%.d)
LANG_SRC=$(wildcard po/*.po)
LANG_CATALOGS=$(LANG_SRC:%.po=%.gmo)
CFLAGS += -MMD -MP
CFLAGS += -I$(PLUGIN_TOP)
CFLAGS += -I$(PURPLE_TOP) -I$(PURPLE_TOP)/win32
CFLAGS += -I$(PIDGIN_TOP) -I$(PIDGIN_TOP)/win32
CFLAGS += -I$(GTK_TOP)/include
CFLAGS += -I$(GTK_TOP)/include/glib-2.0
CFLAGS += -I$(GTK_TOP)/include/gtk-2.0
CFLAGS += -I$(GTK_TOP)/lib/glib-2.0/include
CFLAGS += -I$(GTK_TOP)/include/atk-1.0
CFLAGS += -I$(GTK_TOP)/include/pango-1.0
CFLAGS += -I$(GTK_TOP)/include/cairo
CFLAGS += -I$(GTK_TOP)/lib/gtk-2.0/include
CFLAGS += -I$(SODIUM_TOP)/include
LDFLAGS += -L$(PURPLE_TOP) -lpurple
LDFLAGS += -L$(PIDGIN_TOP) -lpidgin
LDFLAGS += -L$(GTK_TOP)/lib -lglib-2.0 -lgtk-win32-2.0 -lgobject-2.0
LDFLAGS += -lintl -lssp
# This is quite a hack to help us link libsodium statically which makes it
# easier for the users to install the plugin.
#
# Pidgin is built against an old version of mingw which does not ship
# references to the RtlGenRandom/SystemFunction036 function used by libsodium.
# Strawberry Perl happens to ship a newer version which we use here. Since
# libadvapi32 is a system library and we are linking it dynamically, this
# shouldn't cause problems.
#
# On pidgin.im [1] Strawberry Perl is called "a good option" but is actually
# installed when using the pidgin-windev script. So we can call it a build
# dependency for this plugin without upsetting too many developers.
#
# [1]: https://developer.pidgin.im/wiki/BuildingWinPidgin
LDFLAGS += -L$(WIN32_DEV_TOP)/strawberry-perl-5.20.1/c/i686-w64-mingw32/lib -ladvapi32
all: build
build: src/$(PLUGIN).dll $(LANG_CATALOGS)
src/$(PLUGIN).dll: $(OBJ) $(SODIUM_TOP)/lib/libsodium.a
$(CC) -shared $+ $(LDFLAGS) -o $@
$(OBJ): config.h
config.h: .stamp-version-$(PLUGIN_VERSION) configure.ac scripts/gen-mingw-config_h.sh
./scripts/gen-mingw-config_h.sh > config.h
.stamp-version-$(PLUGIN_VERSION):
rm -f .stamp-version*
touch $@
# If configure.ac.in exists, we generate configure.ac. Otherwise we assume that
# configure.ac exists (as in the release tarball).
ifneq ("$(wildcard configure.ac.in)", "")
configure.ac: configure.ac.in .stamp-version-$(PLUGIN_VERSION) ./scripts/gen-configure_ac.sh
./scripts/gen-configure_ac.sh
endif
%.gmo: %.po
rm -f $@
$(GMSGFMT) --statistics -o $@ $<
update-po:
./scripts/po-update.sh
dist: $(PLUGIN_WIN32_ZIP)
$(PLUGIN_WIN32_ZIP): build
./scripts/gen-mingw-dist.sh $@ $(PLUGIN) $(PLUGIN).dll
clean:
rm -f $(OBJ) $(DEP) src/$(PLUGIN).dll
rm -f config.h .stamp-version*
rm -rf $(LANG_CATALOGS)
test -e configure.ac.in && rm -f configure.ac
-include $(DEP)