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