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