14192
|
1 #
|
|
2 # Makefile.mingw
|
|
3 #
|
|
4 # Description: Makefile for win32 (mingw) version of libsametime
|
|
5 #
|
|
6
|
|
7 #
|
|
8 # PATHS
|
|
9 #
|
|
10
|
|
11 SAMETIME_ROOT := .
|
|
12 GTK_TOP := ../../../../win32-dev/gtk_2_0
|
|
13 MEANWHILE_TOP:= ../../../../win32-dev/meanwhile-1.0.2
|
|
14 GAIM_TOP := ../../..
|
|
15 GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir
|
|
16
|
|
17 ##
|
|
18 ## VARIABLE DEFINITIONS
|
|
19 ##
|
|
20
|
|
21 TARGET = libsametime
|
|
22
|
|
23 NEEDED_DLLS = $(MEANWHILE_TOP)/bin/libmeanwhile-1.dll
|
|
24
|
|
25 # Compiler Options
|
|
26
|
|
27 CFLAGS =
|
|
28
|
|
29 DEFINES =
|
|
30
|
|
31 # Static or Plugin...
|
|
32 ifeq ($(TYPE),STATIC)
|
|
33 DEFINES += -DSTATIC
|
|
34 DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR)
|
|
35 else
|
|
36 ifeq ($(TYPE),PLUGIN)
|
|
37 DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR)/plugins
|
|
38 endif
|
|
39 endif
|
|
40
|
|
41
|
|
42 ##
|
|
43 ## INCLUDE MAKEFILES
|
|
44 ##
|
|
45
|
|
46 include $(GAIM_TOP)/src/win32/global.mak
|
|
47
|
|
48 ##
|
|
49 ## INCLUDE PATHS
|
|
50 ##
|
|
51
|
|
52 INCLUDE_PATHS += -I$(SAMETIME_ROOT) \
|
|
53 -I$(MEANWHILE_TOP)/include/meanwhile \
|
|
54 -I$(GTK_TOP)/include \
|
|
55 -I$(GTK_TOP)/include/glib-2.0 \
|
|
56 -I$(GTK_TOP)/lib/glib-2.0/include \
|
|
57 -I$(GAIM_TOP)/src \
|
|
58 -I$(GAIM_TOP)/src/win32 \
|
|
59 -I$(GAIM_TOP)
|
|
60
|
|
61 LIB_PATHS = -L$(GTK_TOP)/lib \
|
|
62 -L$(MEANWHILE_TOP)/lib \
|
|
63 -L$(GAIM_TOP)/src
|
|
64
|
|
65
|
|
66 ##
|
|
67 ## SOURCES, OBJECTS
|
|
68 ##
|
|
69
|
|
70 C_SRC = sametime.c
|
|
71
|
|
72 OBJECTS = $(C_SRC:%.c=%.o)
|
|
73
|
|
74
|
|
75 ##
|
|
76 ## LIBRARIES
|
|
77 ##
|
|
78
|
|
79 LIBS = \
|
|
80 -lglib-2.0 \
|
|
81 -lintl \
|
|
82 -lws2_32 \
|
|
83 -lmeanwhile \
|
|
84 -lgaim \
|
|
85
|
|
86 ##
|
|
87 ## RULES
|
|
88 ##
|
|
89
|
|
90 # How to make a C file
|
|
91
|
|
92 %.o: %.c
|
|
93 $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
|
|
94
|
|
95 ##
|
|
96 ## TARGET DEFINITIONS
|
|
97 ##
|
|
98
|
|
99 .PHONY: all clean
|
|
100
|
|
101 all: $(TARGET).dll
|
|
102
|
|
103 install:
|
|
104 cp $(SAMETIME_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
|
|
105 cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
|
|
106
|
|
107
|
|
108 ##
|
|
109 ## BUILD Dependencies
|
|
110 ##
|
|
111
|
|
112 $(GAIM_TOP)/src/gaim.lib:
|
|
113 $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib
|
|
114
|
|
115 ##
|
|
116 ## BUILD DLL
|
|
117 ##
|
|
118
|
|
119 $(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
|
|
120 $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
|
|
121
|
|
122 ##
|
|
123 ## CLEAN RULES
|
|
124 ##
|
|
125
|
|
126 clean:
|
|
127 rm -rf *.o
|
|
128 rm -rf $(TARGET).dll
|
|
129 rm -rf $(TARGET).lib
|