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