Upstream tarball 10142
[amule.git] / src / Makefile.am
blob4099eb6f6d05ea8a7cd610d6cc0aaea4c4516362
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         GapList.cpp \
67         MagnetURI.cpp \
68         MemFile.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         Friend.cpp \
87         Scanner.cpp \
88         Parser.cpp \
89         PlatformSpecific.cpp \
90         RandomFunctions.cpp \
91         RC4Encrypt.cpp \
92         StateMachine.cpp \
93         ThreadScheduler.cpp \
94         UPnPBase.cpp \
95         kademlia/kademlia/Entry.cpp \
96         kademlia/kademlia/SearchManager.cpp \
97         kademlia/routing/Contact.cpp \
98         kademlia/routing/RoutingBin.cpp \
99         kademlia/utils/UInt128.cpp
101 libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
104 # Common to gui/monolithic
106 libmuleappgui_a_SOURCES = \
107         BarShader.cpp \
108         ChatWnd.cpp \
109         ColorFrameCtrl.cpp \
110         CommentDialog.cpp \
111         CommentDialogLst.cpp \
112         EditServerListDlg.cpp \
113         extern/wxWidgets/listctrl.cpp \
114         FileDetailListCtrl.cpp \
115         IP2Country.cpp \
116         MuleGifCtrl.cpp \
117         MuleListCtrl.cpp \
118         MuleNotebook.cpp \
119         MuleTextCtrl.cpp \
120         MuleCollection.cpp \
121         muuli_wdr.cpp 
123 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS) $(GEOIP_CPPFLAGS)
125 core_sources = \
126         amule.cpp \
127         BaseClient.cpp \
128         CanceledFileList.cpp \
129         ClientList.cpp \
130         ClientCreditsList.cpp \
131         ClientTCPSocket.cpp \
132         ClientUDPSocket.cpp \
133         CorruptionBlackBox.cpp \
134         DownloadClient.cpp \
135         DownloadQueue.cpp \
136         ECSpecialCoreTags.cpp \
137         EMSocket.cpp \
138         EncryptedStreamSocket.cpp \
139         EncryptedDatagramSocket.cpp \
140         ExternalConn.cpp \
141         FriendList.cpp \
142         HTTPDownload.cpp \
143         IPFilter.cpp \
144         KnownFileList.cpp \
145         ListenSocket.cpp \
146         MuleUDPSocket.cpp \
147         PartFileConvert.cpp \
148         SearchFile.cpp \
149         SearchList.cpp \
150         ServerConnect.cpp \
151         ServerList.cpp \
152         ServerSocket.cpp \
153         ServerUDPSocket.cpp \
154         SharedFileList.cpp \
155         TerminationProcessAmuleweb.cpp \
156         ThreadTasks.cpp \
157         UploadBandwidthThrottler.cpp \
158         UploadClient.cpp \
159         UploadQueue.cpp \
160         kademlia/kademlia/Indexed.cpp \
161         kademlia/kademlia/Kademlia.cpp \
162         kademlia/kademlia/Prefs.cpp \
163         kademlia/kademlia/Search.cpp \
164         kademlia/kademlia/UDPFirewallTester.cpp \
165         kademlia/net/KademliaUDPListener.cpp \
166         kademlia/net/PacketTracking.cpp \
167         kademlia/routing/RoutingZone.cpp
170 gui_sources = \
171         amule-gui.cpp \
172         amuleDlg.cpp \
173         AddFriend.cpp \
174         CatDialog.cpp \
175         ChatSelector.cpp \
176         GenericClientListCtrl.cpp \
177         ClientDetailDialog.cpp \
178         DirectoryTreeCtrl.cpp \
179         FileDetailDialog.cpp \
180         KadDlg.cpp \
181         OScopeCtrl.cpp \
182         PartFileConvertDlg.cpp \
183         PrefsUnifiedDlg.cpp \
184         SearchDlg.cpp \
185         ServerWnd.cpp \
186         SharedFilesWnd.cpp \
187         StatisticsDlg.cpp \
188         SearchListCtrl.cpp \
189         DownloadListCtrl.cpp \
190         SourceListCtrl.cpp \
191         SharedFilePeersListCtrl.cpp \
192         FriendListCtrl.cpp \
193         ServerListCtrl.cpp \
194         SharedFilesCtrl.cpp \
195         MuleTrayIcon.cpp \
196         MuleColour.cpp \
197         TransferWnd.cpp 
200 remote_common_sources = \
201         OtherFunctions.cpp \
202         NetworkFunctions.cpp 
204 common_sources = \
205         amuleAppCommon.cpp \
206         ClientCredits.cpp \
207         ECSpecialMuleTags.cpp \
208         KnownFile.cpp \
209         GetTickCount.cpp \
210         GuiEvents.cpp \
211         Logger.cpp \
212         PartFile.cpp \
213         Preferences.cpp \
214         Proxy.cpp \
215         Server.cpp \
216         Statistics.cpp \
217         StatTree.cpp \
218         SHAHashSet.cpp \
219         TerminationProcess.cpp \
220         UserEvents.cpp \
221         $(remote_common_sources)
223 # Libs
225 core_libs = -L. -lmuleappcore $(LIBUPNP_LDFLAGS) $(LIBUPNP_LIBS)
226 gui_libs = -L. -lmuleappgui $(WX_LIBS) $(GEOIP_LDFLAGS) $(GEOIP_LIBS)
227 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
228 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOPP_LDFLAGS) $(CRYPTOPP_LIBS)
230 core_deps = libmuleappcore.a
231 gui_deps = libmuleappgui.a
232 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
233 common_deps = libmuleappcommon.a $(remote_common_deps)
235 if SYS_WIN32
236 core_libs += -lshlwapi
237 endif
240 # Flags
242 core_flags = $(LIBUPNP_CPPFLAGS) $(LIBUPNP_CFLAGS)
243 gui_flags = $(WX_CPPFLAGS) $(GEOIP_CPPFLAGS)
244 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS)
246 # --------- Apps ---------
248 amulegui_SOURCES = \
249         amule-remote-gui.cpp \
250         HTTPDownload.cpp \
251         $(gui_sources) \
252         $(ec_sources) \
253         $(common_sources)
255 amule_SOURCES = \
256         CaptchaDialog.cpp \
257         CaptchaGenerator.cpp \
258         $(core_sources) \
259         $(gui_sources) \
260         $(ec_sources) \
261         $(common_sources)
263 amuled_SOURCES = \
264         amuled.cpp \
265         Timer.cpp \
266         $(core_sources) \
267         $(ec_sources) \
268         $(common_sources)
270 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
271 amule_CPPFLAGS = $(AM_CPPFLAGS) $(core_flags) $(gui_flags) $(common_flags)
272 amule_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CPPFLAGS_ONLY)
273 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
275 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
276 amulegui_CPPFLAGS = $(AM_CPPFLAGS) $(gui_flags) $(common_flags) -DCLIENT_GUI
277 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
278 amulegui_LDADD = $(gui_libs) $(common_libs) $(WXBASE_LIBS)
280 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
281 amuled_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
282 amuled_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
283 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
285 ed2k_SOURCES = \
286         ED2KLinkParser.cpp \
287         MagnetURI.cpp \
288         MuleCollection.cpp      
290 ed2k_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_STD_STRING
292 # on Win32
293 if SYS_WIN32
294 ed2k_LDADD = -lshlwapi
295 endif
296 # on Mac
297 if NEED_CORESERVICES
298 ed2k_LDFLAGS = $(AM_LDFLAGS) -framework CoreServices
299 endif
301 amulecmd_SOURCES = \
302         TextClient.cpp \
303         ExternalConnector.cpp \
304         LoggerConsole.cpp \
305         $(remote_common_sources)
307 amulecmd_DEPENDENCIES = $(remote_common_deps)
308 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags)
309 amulecmd_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
310 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
311 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
312         $(WXBASE_LIBS) $(READLINE_LIBS) $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
314 noinst_HEADERS = \
315                 AddFriend.h \
316                 AsyncDNS.h \
317                 amule-remote-gui.h \
318                 amuleDlg.h \
319                 amule.h \
320                 amuleIPV4Address.h \
321                 ArchSpecific.h \
322                 BarShader.h \
323                 CanceledFileList.h \
324                 CaptchaDialog.h \
325                 CaptchaGenerator.h \
326                 CatDialog.h \
327                 CFile.h \
328                 ChatSelector.h \
329                 ChatWnd.h \
330                 ClientCredits.h \
331                 ClientCreditsList.h \
332                 ClientDetailDialog.h \
333                 SharedFilePeersListCtrl.h \
334                 ClientList.h \
335                 ClientTCPSocket.h \
336                 ClientUDPSocket.h \
337                 ColorFrameCtrl.h \
338                 CommentDialog.h \
339                 CommentDialogLst.h \
340                 Constants.h \
341                 CorruptionBlackBox.h \
342                 CryptoPP_Inc.h \
343                 DataToText.h \
344                 DeadSourceList.h \
345                 DirectoryTreeCtrl.h \
346                 DownloadListCtrl.h \
347                 DownloadQueue.h \
348                 ED2KLink.h \
349                 EditServerListDlg.h \
350                 EMSocket.h \
351                 EncryptedDatagramSocket.h \
352                 EncryptedStreamSocket.h \
353                 ExternalConnector.h \
354                 ExternalConn.h \
355                 FileArea.h \
356                 FileAutoClose.h \
357                 FileDetailDialog.h \
358                 FileDetailListCtrl.h \
359                 FileLock.h \
360                 Friend.h \
361                 FriendListCtrl.h \
362                 FriendList.h \
363                 GapList.h \
364                 GetTickCount.h \
365                 GenericClientListCtrl.h \
366                 GuiEvents.h \
367                 HTTPDownload.h \
368                 inetdownload.h \
369                 InternalEvents.h \
370                 IP2Country.h \
371                 IPFilter.h \
372                 KadDlg.h \
373                 KnownFile.h \
374                 KnownFileList.h \
375                 ListenSocket.h \
376                 Logger.h \
377                 MagnetURI.h \
378                 MD4Hash.h \
379                 MemFile.h \
380                 MuleCollection.h \
381                 MuleColour.h \
382                 MuleGifCtrl.h \
383                 MuleListCtrl.h \
384                 MuleNotebook.h \
385                 MuleTextCtrl.h \
386                 MuleThread.h \
387                 MuleTrayIcon.h \
388                 MuleUDPSocket.h \
389                 muuli_wdr.h \
390                 NetworkFunctions.h \
391                 OScopeCtrl.h \
392                 Observable.h \
393                 ObservableQueue.h \
394                 OtherFunctions.h \
395                 OtherStructs.h \
396                 Packet.h \
397                 Parser.hpp \
398                 PartFileConvert.h \
399                 PartFileConvertDlg.h \
400                 PartFile.h \
401                 PlatformSpecific.h \
402                 Preferences.h \
403                 PrefsUnifiedDlg.h \
404                 Proxy.h \
405                 RangeMap.h \
406                 RC4Encrypt.h \
407                 RLE.h \
408                 RandomFunctions.h \
409                 SafeFile.h \
410                 Scanner.h \
411                 ScopedPtr.h \
412                 SearchDlg.h \
413                 SearchExpr.h \
414                 SearchFile.h \
415                 SearchListCtrl.h \
416                 SearchList.h \
417                 ServerConnect.h \
418                 Server.h \
419                 ServerListCtrl.h \
420                 ServerList.h \
421                 ServerSocket.h \
422                 ServerUDPSocket.h \
423                 ServerWnd.h \
424                 SHA.h \
425                 SHAHashSet.h \
426                 SharedFileList.h \
427                 SharedFilesCtrl.h \
428                 SharedFilesWnd.h \
429                 SourceListCtrl.h \
430                 StateMachine.h \
431                 StatisticsDlg.h \
432                 Statistics.h \
433                 StatTree.h \
434                 Tag.h \
435                 TerminationProcess.h \
436                 TerminationProcessAmuleweb.h \
437                 TextClient.h \
438                 ThreadScheduler.h \
439                 ThreadTasks.h \
440                 ThrottledSocket.h \
441                 Timer.h \
442                 TransferWnd.h \
443                 Types.h \
444                 updownclient.h \
445                 UploadBandwidthThrottler.h \
446                 UploadQueue.h \
447                 UPnPBase.h \
448                 UPnPCompatibility.h \
449                 UserEvents.h \
450                 extern/wxWidgets/listctrl.h
452 MAINTAINERCLEANFILES = Makefile.in
454 $(srcdir)/Parser.cpp: Parser.y
455         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
457 if GENERATE_FLEX_HEADER
458 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
459                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
460 else
461 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
462                 $(LEX) -o $@ $(srcdir)/Scanner.l; \
463                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
464 endif
466 # Resources
468 if NEED_RC
470 SUFFIXES = .rc
472 .rc.$(OBJEXT):
473         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
475 nodist_amuled_SOURCES = amuled-version.rc
476 nodist_amulecmd_SOURCES = amulecmd-version.rc
477 nodist_ed2k_SOURCES = ed2k-version.rc
478 amule_LDADD += amulerc.$(OBJEXT)
479 amule_DEPENDENCIES += amulerc.$(OBJEXT)
480 amulegui_LDADD += amuleguirc.$(OBJEXT)
481 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
483 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
484         cat $^ | \
485         ( \
486                 abs_builddir=`pwd` ; \
487                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
488                 cd $(<D) ; \
489                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
490         )
492 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
493         cat $^ | \
494         ( \
495                 abs_builddir=`pwd` ; \
496                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
497                 cd $(<D) ; \
498                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
499         )
501 amule-version.rc: $(top_builddir)/version.rc
502         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
503              -e 's/VER_INTERNALNAME_STR/"amule"/' \
504              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
506 amuled-version.rc: $(top_builddir)/version.rc
507         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
508              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
509              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
511 amulecmd-version.rc: $(top_builddir)/version.rc
512         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
513              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
514              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
516 amulegui-version.rc: $(top_builddir)/version.rc
517         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
518              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
519              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
521 ed2k-version.rc: $(top_builddir)/version.rc
522         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
523              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
524              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
526 CLEANFILES = *-version.rc
528 endif
531 EXTRA__DIST__SUBDIRS = include kademlia
532 include $(top_srcdir)/automake/dist-hook.am