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