summaryrefslogtreecommitdiffstats
path: root/src/pedro/Makefile.mingw
blob: f108c2c2feb9dff80eb30a198e92c2533f1faf03 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
###########################################################################
#
#
#  Makefile for the Pedro mini-XMPP client
# 
#  Authors:
#    Bob Jamison
# 
#  Copyright (C) 2005-2006 Bob Jamison
# 
#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License as published by the Free Software Foundation; either
#   version 2.1 of the License, or (at your option) any later version.
# 
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
# 
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
#
##########################################################################
# FILE SEPARATORS
# $(S) will be set to one of these
##########################################################################
BSLASH := \\#
FSLASH := /

##########################################################################
# SENSE ARCHITECTURE
##########################################################################
ifdef ComSpec
ARCH=win32
else
ARCH=xlib
endif

##########################################################################
# WIN32  SETTINGS
##########################################################################
ifeq ($(ARCH),win32)

#######  Where is your GTK directory?
GTK=c:/gtk28

####### Same thing, DOS style
GTKDOS=c:\gtk28

#SSL=openssl-0.9.8a
SSL=$(GTK)

CFLAGS = -g -Wall -DHAVE_SSL
INC  = -I. -I$(GTK)/include -I$(SSL)/include


LIBSC = -mconsole -L$(GTK)/lib -L$(SSL) -lssl -lcrypto -lgdi32 -lws2_32
LIBS  = -mwindows -L$(GTK)/lib -L$(SSL) -lssl -lcrypto -lgdi32 -lws2_32

RM = del
CP = copy
S = $(BSLASH)


all: test.exe pedro.exe

GTKINC = -DGLIBMM_DLL \
-I$(GTK)/include/glibmm-2.4 -I$(GTK)/lib/glibmm-2.4/include \
-I$(GTK)/include/gtkmm-2.4  -I$(GTK)/lib/gtkmm-2.4/include \
-I$(GTK)/include/gdkmm-2.4  -I$(GTK)/lib/gdkmm-2.4/include \
-I$(GTK)/include/pangomm-1.4 \
-I$(GTK)/include/atkmm-1.6  -I$(GTK)/include/cairo  \
-I$(GTK)/include/sigc++-2.0 -I$(GTK)/lib/sigc++-2.0/include \
-I$(GTK)/include/gtk-2.0    -I$(GTK)/lib/gtk-2.0/include \
-I$(GTK)/include/atk-1.0    -I$(GTK)/include/pango-1.0 \
-I$(GTK)/include/glib-2.0   -I$(GTK)/lib/glib-2.0/include


####### Our Gtk libs
GTKLIBS = -L$(GTK)/lib -lloudmouth-1 \
-lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4 \
-latkmm-1.6 -lpangomm-1.4 -lsigc-2.0 \
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 \
-lgdk_pixbuf-2.0 -lm -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0 \
-lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0

endif


##########################################################################
# XLIB  SETTINGS
##########################################################################
ifeq ($(ARCH),xlib)

CFLAGS = -g -Wall -DHAVE_SSL -DHAVE_PTHREAD_H
XINC = -I/usr/X11R6/include
XLIB = -L/usr/X11R6/lib -lXrender -lX11
INC  = -I. -I.. $(XINC)
LIBS = $(XLIB) -lpthread -lssl
RM = rm -rf
CP = cp
S = $(FSLASH)
all: test pedro

GTKINC  += `pkg-config gtkmm-2.4 --cflags`
GTKLIBS += `pkg-config gtkmm-2.4 --libs`

endif



OBJ =         \
pedrodom.o    \
pedroxmpp.o   \
pedroconfig.o \
pedroutil.o


GUIOBJ = \
pedrogui.o \
pedromain.o


TESTOBJ = \
work/test.o     \
work/filesend.o \
work/filerec.o  \
work/groupchat.o

test.exe: libpedro.a work/test.o
	$(CXX) -o $@ work/test.o libpedro.a $(LIBSC)
test: libpedro.a work/test.o
	$(CXX) -o $@ work/test.o libpedro.a $(LIBSC)
        
filesend.exe: libpedro.a work/filesend.o
	$(CXX) -o $@ work/filesend.o libpedro.a $(LIBSC)
filesend: libpedro.a work/filesend.o
	$(CXX) -o $@ work/filesend.o libpedro.a $(LIBSC)

filerec.exe: libpedro.a work/filerec.o
	$(CXX) -o $@ work/filerec.o libpedro.a $(LIBSC)
filerec: libpedro.a work/filerec.o
	$(CXX) -o $@ work/filerec.o libpedro.a $(LIBSC)

groupchat.exe: libpedro.a work/groupchat.o
	$(CXX) -o $@ work/groupchat.o libpedro.a $(LIBSC)
groupchat: libpedro.a work/groupchat.o
	$(CXX) -o $@ work/groupchat.o libpedro.a $(LIBSC)

pedro.exe: libpedro.a pedromain.o pedrogui.o
	$(CXX) -o $@ pedromain.o pedrogui.o libpedro.a $(GTKLIBS) $(LIBS)
pedro: libpedro.a pedromain.o pedrogui.o
	$(CXX) -o $@ pedromain.o pedrogui.o libpedro.a $(GTKLIBS) $(LIBS)


libpedro.a: $(OBJ)
	ar crv libpedro.a $(OBJ)

pedromain.o: pedromain.cpp
	$(CXX) $(CFLAGS) $(INC) $(GTKINC) -c -o $@ $<
        
pedrogui.o: pedrogui.cpp pedrogui.h
	$(CXX) $(CFLAGS) $(INC) $(GTKINC) -c -o $@ $<

.cpp.o:
	$(CXX) $(CFLAGS) $(INC) -c -o $@ $<

clean:
	$(foreach a, $(OBJ), $(shell $(RM) $(subst /,$(S), $(a))))
	$(foreach a, $(GUIOBJ), $(shell $(RM) $(subst /,$(S), $(a))))
	$(foreach a, $(TESTOBJ), $(shell $(RM) $(subst /,$(S), $(a))))
	-$(RM) *.a
	-$(RM) test
	-$(RM) test.exe
	-$(RM) filesend
	-$(RM) filesend.exe
	-$(RM) filerec
	-$(RM) filerec.exe
	-$(RM) groupchat
	-$(RM) groupchat.exe
	-$(RM) pedro
	-$(RM) pedro.exe
	-$(RM) core.*

###########################################################################
# E N D    O F    F I L E
###########################################################################