forked from davidgfnet/whatsapp-purple
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.mingw
63 lines (48 loc) · 1.23 KB
/
Makefile.mingw
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
LIBNAME = libwhatsapp.dll
.PHONY: all
all: $(LIBNAME)
C_SRCS = wa_purple.c
CXX_SRCS = whatsapp-protocol.cc wa_api.cc
C_OBJS = $(C_SRCS:.c=.o)
CXX_OBJS = $(CXX_SRCS:.cc=.o)
STRIP = strip
CC = i686-w64-mingw32-gcc
CXX = i686-w64-mingw32-g++
LD = $(CXX)
CFLAGS_PURPLE = $(shell mingw32-pkg-config --cflags purple)
CFLAGS = \
-O2 \
-m32 \
-Wall \
-Wextra \
-fPIC \
-DPURPLE_PLUGINS \
-DPIC \
$(CFLAGS_PURPLE) \
$(EXTRAINCLUDES)
LIBS_PURPLE = $(shell mingw32-pkg-config --libs purple) -static-libgcc -static-libstdc++ $(EXTRALIBS)
LDFLAGS = -shared
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.cc
$(CXX) -c $(CFLAGS) -o $@ $<
$(LIBNAME): $(C_OBJS) $(CXX_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS_PURPLE)
PLUGIN_DIR_PURPLE:=$(shell mingw32-pkg-config --variable=plugindir purple)
DATA_ROOT_DIR_PURPLE:=$(shell mingw32-pkg-config --variable=datarootdir purple)
.PHONY: install
install: $(LIBNAME)
install -D $(LIBNAME) $(PLUGIN_DIR_PURPLE)/$(LIBNAME)
.PHONY: uninstall
uninstall: $(LIBNAME)
rm $(PLUGIN_DIR_PURPLE)/$(LIBNAME)
.PHONY: strip
strip: $(LIBNAME)
$(STRIP) --strip-debug --discard-locals $(LIBNAME)
.PHONY: debug
debug: CFLAGS += -g -DDEBUG
debug: $(LIBNAME)
.PHONY: clean
clean:
-rm *.o
-rm $(LIBNAME)