Upstream tarball 20080902
[amule.git] / src / Makefile.am
blob3a26117b3df36c9fd61d7f79d6932e5aab76ed04
1 AM_CPPFLAGS = $(MULECPPFLAGS)
2 AM_CFLAGS = $(MULECFLAGS)
3 AM_CXXFLAGS = $(MULECXXFLAGS)
4 AM_LDFLAGS = $(MULELDFLAGS)
6 SUBDIRS = libs utils pixmaps skins
8 if WEB
9 SUBDIRS += webserver
10 endif
12 EXTRA_DIST = \
13         aMule.xpm \
14         Parser.y \
15         Scanner.h.in \
16         Scanner.l \
17         muuli.wdr 
19 bin_PROGRAMS = 
21 if MONOLITHIC
22 bin_PROGRAMS += amule
23 endif
25 if COMPILE_CMD
26 bin_PROGRAMS += amulecmd   
27 endif
29 if ED2K
30 bin_PROGRAMS += ed2k
31 endif
33 if AMULE_GUI
34 bin_PROGRAMS += amulegui
35 endif
37 if AMULE_DAEMON
38 bin_PROGRAMS += amuled
39 endif
41 # Sources
42 noinst_LIBRARIES =
43 if MONOLITHIC
44 noinst_LIBRARIES += libmuleappcore.a libmuleappgui.a libmuleappcommon.a
45 else
46 if AMULE_DAEMON
47 noinst_LIBRARIES += libmuleappcore.a libmuleappcommon.a
48 else
49 if AMULE_GUI
50 noinst_LIBRARIES += libmuleappgui.a libmuleappcommon.a
51 endif
52 endif
53 endif
56 # Common to core/gui/monolithic
58 libmuleappcommon_a_SOURCES = \
59         CFile.cpp \
60         DataToText.cpp \
61         ED2KLink.cpp \
62         MagnetURI.cpp \
63         MemFile.cpp \
64         NetworkFunctions.cpp \
65         Packet.cpp \
66         RLE.cpp \
67         SafeFile.cpp \
68         SHA.cpp \
69         Tag.cpp \
70         Timer.cpp \
71         RandomFunctions.cpp \
72         kademlia/utils/UInt128.cpp
74 libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
77 # Common to core/monolithic
79 libmuleappcore_a_SOURCES = \
80         AsyncDNS.cpp \
81         DeadSourceList.cpp \
82         Scanner.cpp \
83         Parser.cpp \
84         PlatformSpecific.cpp \
85         kademlia/kademlia/Entry.cpp \
86         kademlia/kademlia/SearchManager.cpp \
87         kademlia/routing/RoutingBin.cpp \
88         StateMachine.cpp \
89         ThreadScheduler.cpp
91 libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
94 # Common to gui/monolithic
96 libmuleappgui_a_SOURCES = \
97         BarShader.cpp \
98         ChatWnd.cpp \
99         ColorFrameCtrl.cpp \
100         CommentDialog.cpp \
101         CommentDialogLst.cpp \
102         DirectoryTreeCtrl.cpp \
103         EditServerListDlg.cpp \
104         extern/wxWidgets/listctrl.cpp \
105         FileDetailListCtrl.cpp \
106         MuleGifCtrl.cpp \
107         MuleListCtrl.cpp \
108         MuleNotebook.cpp \
109         MuleTextCtrl.cpp \
110         MuleCollection.cpp \
111         muuli_wdr.cpp 
113 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS)
115 core_sources = \
116         RC4Encrypt.cpp \
117         amule.cpp \
118         BaseClient.cpp \
119         ClientList.cpp \
120         ClientCreditsList.cpp \
121         ClientTCPSocket.cpp \
122         ClientUDPSocket.cpp \
123         DownloadClient.cpp \
124         DownloadQueue.cpp \
125         ECSpecialCoreTags.cpp \
126         EMSocket.cpp \
127         EncryptedStreamSocket.cpp \
128         EncryptedDatagramSocket.cpp \
129         ExternalConn.cpp \
130         Friend.cpp \
131         FriendList.cpp \
132         HTTPDownload.cpp \
133         IPFilter.cpp \
134         KnownFileList.cpp \
135         ListenSocket.cpp \
136         MuleUDPSocket.cpp \
137         SearchFile.cpp \
138         SearchList.cpp \
139         ServerConnect.cpp \
140         ServerList.cpp \
141         ServerSocket.cpp \
142         ServerUDPSocket.cpp \
143         SharedFileList.cpp \
144         ThreadTasks.cpp \
145         UploadBandwidthThrottler.cpp \
146         UploadClient.cpp \
147         UploadQueue.cpp \
148         kademlia/kademlia/Indexed.cpp \
149         kademlia/kademlia/Kademlia.cpp \
150         kademlia/kademlia/Prefs.cpp \
151         kademlia/kademlia/Search.cpp \
152         kademlia/kademlia/UDPFirewallTester.cpp \
153         kademlia/net/KademliaUDPListener.cpp \
154         kademlia/net/PacketTracking.cpp \
155         kademlia/routing/Contact.cpp \
156         kademlia/routing/RoutingZone.cpp
158 if ENABLE_UPNP
159 core_sources += \
160         UPnPBase.cpp \
161         UPnPCompatibility.cpp
162 endif
164 gui_sources = \
165         amule-gui.cpp \
166         amuleDlg.cpp \
167         AddFriend.cpp \
168         CatDialog.cpp \
169         ChatSelector.cpp \
170         ClientDetailDialog.cpp \
171         FileDetailDialog.cpp \
172         KadDlg.cpp \
173         OScopeCtrl.cpp \
174         PartFileConvert.cpp \
175         PrefsUnifiedDlg.cpp \
176         SearchDlg.cpp \
177         ServerWnd.cpp \
178         SharedFilesWnd.cpp \
179         StatisticsDlg.cpp \
180         SearchListCtrl.cpp \
181         DownloadListCtrl.cpp \
182         ClientListCtrl.cpp \
183         FriendListCtrl.cpp \
184         ServerListCtrl.cpp \
185         SharedFilesCtrl.cpp \
186         MuleTrayIcon.cpp \
187         MuleColour.cpp \
188         TransferWnd.cpp 
190 if ENABLE_IP2COUNTRY
191 gui_sources += \
192         IP2Country.cpp
193 endif
196 remote_common_sources = \
197         OtherFunctions.cpp \
198         NetworkFunctions.cpp 
200 common_sources = \
201         ClientCredits.cpp \
202         ECSpecialMuleTags.cpp \
203         KnownFile.cpp \
204         GetTickCount.cpp \
205         GuiEvents.cpp \
206         Logger.cpp \
207         PartFile.cpp \
208         Preferences.cpp \
209         Proxy.cpp \
210         Server.cpp \
211         Statistics.cpp \
212         StatTree.cpp \
213         SHAHashSet.cpp \
214         TerminationProcess.cpp \
215         TerminationProcessAmuleweb.cpp \
216         UserEvents.cpp \
217         $(remote_common_sources)
219 # Libs
221 core_libs = -L. -lmuleappcore $(LIBUPNP_LDFLAGS) $(LIBUPNP_LIBS)
222 gui_libs = -L. -lmuleappgui $(X11LIBS) $(WX_LIBS) $(GEOIP_LDFLAGS) $(GEOIP_LIBS)
223 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB) $(BFD_LIBS)
224 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOPP_LDFLAGS) $(CRYPTOPP_LIBS)
226 core_deps = libmuleappcore.a
227 gui_deps = libmuleappgui.a
228 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
229 common_deps = libmuleappcommon.a $(remote_common_deps)
231 if SYS_WIN32
232 core_libs += -lshlwapi
233 endif
236 # Flags
238 core_flags = $(LIBUPNP_CPPFLAGS) $(LIBUPNP_CFLAGS)
239 gui_flags = $(WX_CPPFLAGS) $(GEOIP_CPPFLAGS)
240 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS)
242 # --------- Apps ---------
244 amulegui_SOURCES = \
245         amule-remote-gui.cpp \
246         $(gui_sources) \
247         $(ec_sources) \
248         $(common_sources)
250 amule_SOURCES = \
251         $(core_sources) \
252         $(gui_sources) \
253         $(ec_sources) \
254         $(common_sources)
256 amuled_SOURCES = \
257         amuled.cpp \
258         Timer.cpp \
259         $(core_sources) \
260         $(ec_sources) \
261         $(common_sources)
263 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
264 amule_CPPFLAGS = $(AM_CPPFLAGS) $(core_flags) $(gui_flags) $(common_flags)
265 amule_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CPPFLAGS_ONLY)
266 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
268 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
269 amulegui_CPPFLAGS = $(AM_CPPFLAGS) $(gui_flags) $(common_flags) -DCLIENT_GUI -DEC_REMOTE
270 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
271 amulegui_LDADD = $(gui_libs) $(common_libs) $(WXBASE_LIBS)
273 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
274 amuled_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
275 amuled_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
276 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
278 ed2k_SOURCES = \
279         ED2KLinkParser.cpp \
280         MagnetURI.cpp \
281         MuleCollection.cpp      
283 ed2k_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_STD_STRING
285 # on Win32
286 if SYS_WIN32
287 ed2k_LDADD = -lshlwapi
288 endif
289 # on Mac
290 if NEED_CORESERVICES
291 ed2k_LDFLAGS = $(AM_LDFLAGS) -framework CoreServices
292 endif
294 amulecmd_SOURCES = \
295         TextClient.cpp \
296         ExternalConnector.cpp \
297         $(remote_common_sources)
299 amulecmd_DEPENDENCIES = $(remote_common_deps)
300 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
301 amulecmd_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
302 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
303 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
304         $(WXBASE_LIBS) $(READLINE_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) \
305         $(RESOLV_LIB) $(BFD_LIBS)
307 noinst_HEADERS = \
308                 AddFriend.h \
309                 AsyncDNS.h \
310                 amule-remote-gui.h \
311                 amuleDlg.h \
312                 amule.h \
313                 amuleIPV4Address.h \
314                 ArchSpecific.h \
315                 BarShader.h \
316                 CatDialog.h \
317                 CFile.h \
318                 ChatSelector.h \
319                 ChatWnd.h \
320                 ClientCredits.h \
321                 ClientCreditsList.h \
322                 ClientDetailDialog.h \
323                 ClientListCtrl.h \
324                 ClientList.h \
325                 ClientTCPSocket.h \
326                 ClientUDPSocket.h \
327                 ColorFrameCtrl.h \
328                 CommentDialog.h \
329                 CommentDialogLst.h \
330                 Constants.h \
331                 CryptoPP_Inc.h \
332                 DataToText.h \
333                 DeadSourceList.h \
334                 DirectoryTreeCtrl.h \
335                 DownloadListCtrl.h \
336                 DownloadQueue.h \
337                 ED2KLink.h \
338                 EditServerListDlg.h \
339                 EMSocket.h \
340                 EncryptedDatagramSocket.h \
341                 EncryptedStreamSocket.h \
342                 ExternalConnector.h \
343                 ExternalConn.h \
344                 FileDetailDialog.h \
345                 FileDetailListCtrl.h \
346                 FileLock.h \
347                 Friend.h \
348                 FriendListCtrl.h \
349                 FriendList.h \
350                 GetTickCount.h \
351                 GuiEvents.h \
352                 HTTPDownload.h \
353                 inetdownload.h \
354                 InternalEvents.h \
355                 IP2Country.h \
356                 IPFilter.h \
357                 KadDlg.h \
358                 KnownFile.h \
359                 KnownFileList.h \
360                 ListenSocket.h \
361                 Logger.h \
362                 MagnetURI.h \
363                 MD4Hash.h \
364                 MemFile.h \
365                 MuleCollection.h \
366                 MuleColour.h \
367                 MuleGifCtrl.h \
368                 MuleListCtrl.h \
369                 MuleNotebook.h \
370                 MuleTextCtrl.h \
371                 MuleThread.h \
372                 MuleTrayIcon.h \
373                 MuleUDPSocket.h \
374                 muuli_wdr.h \
375                 NetworkFunctions.h \
376                 OScopeCtrl.h \
377                 Observable.h \
378                 ObservableQueue.h \
379                 OtherFunctions.h \
380                 OtherStructs.h \
381                 Packet.h \
382                 Parser.hpp \
383                 PartFileConvert.h \
384                 PartFile.h \
385                 PlatformSpecific.h \
386                 Preferences.h \
387                 PrefsUnifiedDlg.h \
388                 Proxy.h \
389                 RangeMap.h \
390                 RC4Encrypt.h \
391                 RLE.h \
392                 RandomFunctions.h \
393                 SafeFile.h \
394                 Scanner.h \
395                 ScopedPtr.h \
396                 SearchDlg.h \
397                 SearchExpr.h \
398                 SearchFile.h \
399                 SearchListCtrl.h \
400                 SearchList.h \
401                 ServerConnect.h \
402                 Server.h \
403                 ServerListCtrl.h \
404                 ServerList.h \
405                 ServerSocket.h \
406                 ServerUDPSocket.h \
407                 ServerWnd.h \
408                 SHA.h \
409                 SHAHashSet.h \
410                 SharedFileList.h \
411                 SharedFilesCtrl.h \
412                 SharedFilesWnd.h \
413                 StateMachine.h \
414                 StatisticsDlg.h \
415                 Statistics.h \
416                 StatTree.h \
417                 Tag.h \
418                 TerminationProcess.h \
419                 TerminationProcessAmuleweb.h \
420                 TextClient.h \
421                 ThreadScheduler.h \
422                 ThreadTasks.h \
423                 ThrottledSocket.h \
424                 Timer.h \
425                 TransferWnd.h \
426                 Types.h \
427                 updownclient.h \
428                 UploadBandwidthThrottler.h \
429                 UploadQueue.h \
430                 UPnPBase.h \
431                 UPnPCompatibility.h \
432                 UserEvents.h \
433                 extern/wxWidgets/listctrl.h
435 MAINTAINERCLEANFILES = Makefile.in
437 $(srcdir)/Parser.cpp: Parser.y
438         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
440 if GENERATE_FLEX_HEADER
441 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
442                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
443 else
444 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
445                 $(LEX) -o$@ $(srcdir)/Scanner.l; \
446                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
447 endif
449 # Resources
451 if NEED_RC
453 SUFFIXES = .rc
455 .rc.$(OBJEXT):
456         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
458 nodist_amuled_SOURCES = amuled-version.rc
459 nodist_amulecmd_SOURCES = amulecmd-version.rc
460 nodist_ed2k_SOURCES = ed2k-version.rc
461 amule_LDADD += amulerc.$(OBJEXT)
462 amule_DEPENDENCIES += amulerc.$(OBJEXT)
463 amulegui_LDADD += amuleguirc.$(OBJEXT)
464 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
466 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
467         cat $^ | \
468         ( \
469                 abs_builddir=`pwd` ; \
470                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
471                 cd $(<D) ; \
472                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
473         )
475 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
476         cat $^ | \
477         ( \
478                 abs_builddir=`pwd` ; \
479                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
480                 cd $(<D) ; \
481                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
482         )
484 amule-version.rc: $(top_builddir)/version.rc
485         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
486              -e 's/VER_INTERNALNAME_STR/"amule"/' \
487              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
489 amuled-version.rc: $(top_builddir)/version.rc
490         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
491              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
492              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
494 amulecmd-version.rc: $(top_builddir)/version.rc
495         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
496              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
497              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
499 amulegui-version.rc: $(top_builddir)/version.rc
500         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
501              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
502              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
504 ed2k-version.rc: $(top_builddir)/version.rc
505         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
506              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
507              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
509 CLEANFILES = *-version.rc
511 endif
514 EXTRA__DIST__SUBDIRS = include kademlia remote-gui.net
515 include $(top_srcdir)/automake/dist-hook.am