comparison libgaim/Makefile.mingw @ 14315:8793fc8f7064

[gaim-migrate @ 17008] Lee Roach revamped the win32 makefiles. This makes me happy, they were in dire need of some loving. This makes life a great deal easier for anyone who wants to build out-of-tree plugins. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 23 Aug 2006 21:34:43 +0000
parents c54ea2572de9
children fd45915c6988
comparison
equal deleted inserted replaced
14314:8b8188fa98f4 14315:8793fc8f7064
1 # 1 #
2 # Makefile.mingw 2 # Makefile.mingw
3 # 3 #
4 # Description: Makefile for win32 (mingw) version of Gaim 4 # Description: Makefile for win32 (mingw) version of libGaim
5 # 5 #
6 6
7 # 7 GAIM_TOP := ..
8 # PATHS 8 include $(GAIM_TOP)/libgaim/win32/global.mak
9 #
10
11 GTK_TOP := ../../win32-dev/gtk_2_0
12 GAIM_TOP := ..
13 LIBGAIM_TOP := .
14 PLUGINS_TOP := $(LIBGAIM_TOP)/plugins
15 PROTOCOLS_TOP := $(LIBGAIM_TOP)/protocols
16 GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir
17 LIBXML2_DIR := ../../win32-dev/libxml2
18
19 NEEDED_DLLS = $(LIBXML2_DIR)/bin/libxml2.dll
20
21
22 ##
23 ## VARIABLE DEFINITIONS
24 ##
25 9
26 TARGET = libgaim 10 TARGET = libgaim
27 11 NEEDED_DLLS = $(LIBXML2_TOP)/bin/libxml2.dll
28 # Compiler and Linker Options
29
30 CFLAGS =
31
32 DEFINES =
33
34 ##
35 ## INCLUDE MAKEFILES
36 ##
37
38 include $(LIBGAIM_TOP)/win32/global.mak
39 12
40 ## 13 ##
41 ## INCLUDE PATHS 14 ## INCLUDE PATHS
42 ## 15 ##
43
44 INCLUDE_PATHS = \ 16 INCLUDE_PATHS = \
45 -I$(LIBGAIM_TOP) \ 17 -I$(GAIM_LIB_TOP) \
46 -I$(LIBGAIM_TOP)/win32 \ 18 -I$(GAIM_LIB_TOP)/win32 \
47 -I$(GAIM_TOP) \ 19 -I$(GAIM_TOP) \
48 -I$(GTK_TOP)/include \ 20 -I$(GTK_TOP)/include \
49 -I$(GTK_TOP)/include/glib-2.0 \ 21 -I$(GTK_TOP)/include/glib-2.0 \
50 -I$(GTK_TOP)/lib/glib-2.0/include \ 22 -I$(GTK_TOP)/lib/glib-2.0/include \
51 -I$(LIBXML2_DIR)/include 23 -I$(LIBXML2_TOP)/include
52 24
53 LIB_PATHS = -L$(GTK_TOP)/lib \ 25 LIB_PATHS = -L$(GTK_TOP)/lib \
54 -L$(LIBGAIM_TOP) \ 26 -L$(LIBXML2_TOP)/lib
55 -L$(LIBXML2_DIR)/lib
56 27
57 ## 28 ##
58 ## SOURCES, OBJECTS 29 ## SOURCES, OBJECTS
59 ## 30 ##
60
61 C_SRC = \ 31 C_SRC = \
62 account.c \ 32 account.c \
63 accountopt.c \ 33 accountopt.c \
64 blist.c \ 34 blist.c \
65 buddyicon.c \ 35 buddyicon.c \
104 xmlnode.c \ 74 xmlnode.c \
105 whiteboard.c \ 75 whiteboard.c \
106 win32/libc_interface.c \ 76 win32/libc_interface.c \
107 win32/win32dep.c 77 win32/win32dep.c
108 78
109
110 OBJECTS = $(C_SRC:%.c=%.o) 79 OBJECTS = $(C_SRC:%.c=%.o)
111 80
112 ## 81 ##
113 ## LIBRARIES 82 ## LIBRARIES
114 ## 83 ##
115
116 LIBS = \ 84 LIBS = \
117 -lglib-2.0 \ 85 -lglib-2.0 \
118 -lgthread-2.0 \ 86 -lgthread-2.0 \
119 -lgobject-2.0 \ 87 -lgobject-2.0 \
120 -lgmodule-2.0 \ 88 -lgmodule-2.0 \
121 -lintl \ 89 -lintl \
122 -lws2_32 \ 90 -lws2_32 \
123 -liberty \ 91 -liberty \
124 -lxml2 92 -lxml2
125 93
126 ## 94 include $(GAIM_COMMON_RULES)
127 ## RULES
128 ##
129
130 # How to make a C file
131 %.o: %.c
132 $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
133 95
134 ## 96 ##
135 ## TARGET DEFINITIONS 97 ## TARGET DEFINITIONS
136 ## 98 ##
137 99 .PHONY: all clean
138 .PHONY: all clean include_path
139 100
140 all: $(TARGET).dll 101 all: $(TARGET).dll
141 $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw 102 $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE)
142 $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw 103 $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE)
143 104
144 install: all 105 install: all $(GAIM_INSTALL_DIR)
145 $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw install 106 $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
146 $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw install 107 $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
147 cp $(LIBGAIM_TOP)/$(TARGET).dll $(GAIM_INSTALL_DIR) 108 cp $(TARGET).dll $(GAIM_INSTALL_DIR)
148 cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR) 109 cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
149 110
150 # 111 $(OBJECTS): $(GAIM_CONFIG_H)
151 # BUILD DLL 112
152 # 113 $(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
153 $(TARGET).dll.a $(TARGET).dll:
154 $(TARGET).dll.a $(TARGET).dll: $(OBJECTS)
155 $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll 114 $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
156 115
157 ## 116 ##
158 ## CLEAN RULES 117 ## CLEAN RULES
159 ## 118 ##
160
161 clean: 119 clean:
162 rm -rf *.o ./win32/*.o 120 rm -rf $(OBJECTS)
163 rm -rf $(TARGET).dll 121 rm -rf $(TARGET).dll
164 rm -rf $(TARGET).dll.a 122 rm -rf $(TARGET).dll.a
165 $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw clean 123 $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
166 $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw clean 124 $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
125
126 include $(GAIM_COMMON_TARGETS)