Blame view

libpurple/Makefile 3.8 KB
c5625f6d   Matti Virkkunen   Add makefile opti...
1
2
3
4
5
6
7
8
  THRIFT_STATIC_DIR = thrift_static
  
  ifdef THRIFT_STATIC
  	THRIFT = $(THRIFT_STATIC_DIR)/compiler/cpp/thrift
  	THRIFT_CXXFLAGS = -I$(THRIFT_STATIC_DIR)/lib/cpp/src
  	THRIFT_LIBS = -L$(THRIFT_STATIC_DIR)/lib/cpp/.libs -Wl,-Bstatic -lthrift -Wl,-Bdynamic
  	THRIFT_DEP = $(THRIFT)
  else
196531c3   Matti Virkkunen   Use environment s...
9
  	THRIFT ?= thrift
c5625f6d   Matti Virkkunen   Add makefile opti...
10
11
12
13
  	THRIFT_CXXFLAGS = `pkg-config --cflags thrift`
  	THRIFT_LIBS = `pkg-config --libs thrift`
  endif
  
196531c3   Matti Virkkunen   Use environment s...
14
  CXX ?= g++
57db2b54   Matti Virkkunen   Enable more warni...
15
  CXXFLAGS = -g -Wall -Wextra -Werror -pedantic -shared -fPIC \
48d0763a   Matti Virkkunen   Moved source to s...
16
  	-DHAVE_INTTYPES_H -DHAVE_CONFIG_H -DPURPLE_PLUGINS \
a081c151   Matti Virkkunen   Add libgpg-error ...
17
18
  	`pkg-config --cflags purple` `libgcrypt-config --cflags` `gpg-error-config --cflags` \
  	$(THRIFT_CXXFLAGS)
48d0763a   Matti Virkkunen   Moved source to s...
19
  
a081c151   Matti Virkkunen   Add libgpg-error ...
20
21
  LIBS = `pkg-config --libs purple` `libgcrypt-config --libs` `gpg-error-config --libs` \
  	$(THRIFT_LIBS)
48d0763a   Matti Virkkunen   Moved source to s...
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  
  PURPLE_PLUGIN_DIR:=$(shell pkg-config --variable=plugindir purple)
  PURPLE_DATA_ROOT_DIR:=$(shell pkg-config --variable=datarootdir purple)
  
  MAIN = libline.so
  
  GEN_SRCS = thrift_line/line_constants.cpp thrift_line/line_types.cpp \
  	thrift_line/TalkService.cpp
  REAL_SRCS = pluginmain.cpp linehttptransport.cpp thriftclient.cpp httpclient.cpp \
  	purpleline.cpp purpleline_blist.cpp purpleline_chats.cpp purpleline_cmds.cpp \
  	purpleline_login.cpp purpleline_write.cpp \
  	poller.cpp pinverifier.cpp
  SRCS += $(GEN_SRCS)
  SRCS += $(REAL_SRCS)
  
  OBJS = $(SRCS:.cpp=.o)
  
  all: $(MAIN)
  
c5625f6d   Matti Virkkunen   Add makefile opti...
41
  $(MAIN): $(OBJS) $(THRIFT_DEP)
48d0763a   Matti Virkkunen   Moved source to s...
42
  	$(CXX) $(CXXFLAGS) -Wl,-z,defs -o $(MAIN) $(OBJS) $(LIBS)
c5625f6d   Matti Virkkunen   Add makefile opti...
43
  	strip $(MAIN)
48d0763a   Matti Virkkunen   Moved source to s...
44
45
46
47
  
  .cpp.o:
  	$(CXX) $(CXXFLAGS) -std=c++11 -c $< -o $@
  
81d7bf7a   Matti Virkkunen   Fix make dependen...
48
49
  # The Thrift generator generates three files at once, this file shall represent them.
  thrift_line/TalkService.cpp: line.thrift $(THRIFT_DEP) $@
48d0763a   Matti Virkkunen   Moved source to s...
50
51
52
  	mkdir -p thrift_line
  	$(THRIFT) --gen cpp -out thrift_line line.thrift
  
81d7bf7a   Matti Virkkunen   Fix make dependen...
53
54
55
  # If the representative file exists, the others should too.
  thrift_line/line_types.cpp thrift_line/line_constants.cpp: thrift_line/TalkService.cpp
  
c5625f6d   Matti Virkkunen   Add makefile opti...
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  $(THRIFT):
  	mkdir -p $(THRIFT_STATIC_DIR)
  	wget -P $(THRIFT_STATIC_DIR) \
  		http://mirror.netinch.com/pub/apache/thrift/0.9.2/thrift-0.9.2.tar.gz
  	tar xf $(THRIFT_STATIC_DIR)/thrift-0.9.2.tar.gz	\
  		-C $(THRIFT_STATIC_DIR) --strip-components 1
  	cd $(THRIFT_STATIC_DIR); ./configure \
  		--with-pic \
  		--disable-tests --disable-tutorial \
  		--without-libevent --without-zlib --without-qt4 --without-c_glib --without-csharp \
  		--without-java --without-erlang --without-python --without-perl --without-php \
  		--without-php_extension --without-ruby --without-haskell --without-go --without-d \
  		--without-nodejs --without-lua  --without-openssl
  	$(MAKE) -C $(THRIFT_STATIC_DIR)
  
48d0763a   Matti Virkkunen   Moved source to s...
71
72
  .PHONY: clean
  clean:
81d7bf7a   Matti Virkkunen   Fix make dependen...
73
  	rm -f .depend
48d0763a   Matti Virkkunen   Moved source to s...
74
75
76
  	rm -f $(MAIN)
  	rm -f *.o
  	rm -rf thrift_line
c5625f6d   Matti Virkkunen   Add makefile opti...
77
  	rm -rf $(THRIFT_STATIC_DIR)
48d0763a   Matti Virkkunen   Moved source to s...
78
79
80
81
82
83
84
85
86
87
88
89
  
  .PHONY: user-install
  user-install: all
  	install -D $(MAIN) ~/.purple/plugins/$(MAIN)
  
  .PHONY: user-uninstall
  user-uninstall:
  	rm -f ~/.purple/plugins/$(MAIN)
  
  .PHONY: install
  install: all
  	install -D $(MAIN) $(DESTDIR)$(PURPLE_PLUGIN_DIR)/$(MAIN)
92e8a219   Matti Virkkunen   Set correct permi...
90
91
92
93
  	install -m 644 -D ../icons/16/line.png $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/16/line.png
  	install -m 644 -D ../icons/22/line.png $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/22/line.png
  	install -m 644 -D ../icons/48/line.png $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/48/line.png
  	install -m 644 -D ../icons/scalable/line.svg $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/scalable/line.svg
48d0763a   Matti Virkkunen   Moved source to s...
94
95
96
97
  
  .PHONY: uninstall
  uninstall:
  	rm -f $(DESTDIR)$(PURPLE_PLUGIN_DIR)/$(MAIN)
f3ab2005   Saket Srivastava   Modifies Makefile...
98
99
100
101
  	rm -f $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/16/line.png
  	rm -f $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/22/line.png
  	rm -f $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/48/line.png
  	rm -f $(DESTDIR)$(PURPLE_DATA_ROOT_DIR)/pixmaps/pidgin/protocols/scalable/line.svg
48d0763a   Matti Virkkunen   Moved source to s...
102
103
104
  
  depend: .depend
  
81d7bf7a   Matti Virkkunen   Fix make dependen...
105
106
  .depend: $(SRCS)
  	$(CXX) $(CXXFLAGS) -MM $(REAL_SRCS) >.depend
48d0763a   Matti Virkkunen   Moved source to s...
107
  
c5625f6d   Matti Virkkunen   Add makefile opti...
108
  ifneq ($(MAKECMDGOALS),clean)
06e7f62e   Matti Virkkunen   Don't refresh dep...
109
  ifneq ($(MAKECMDGOALS),uninstall)
48d0763a   Matti Virkkunen   Moved source to s...
110
  -include .depend
c5625f6d   Matti Virkkunen   Add makefile opti...
111
  endif
06e7f62e   Matti Virkkunen   Don't refresh dep...
112
  endif