Fix a typo in xas.1 (thanks to Marcell)
[amule.git] / src / Makefile.am
blob47bb20ad6492fe1a3e87cb1e461942fbece4a176
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 # build webserver after current
10 SUBDIRS += . webserver
11 endif
13 if INSTALL_SKINS
14 SUBDIRS += skins
15 endif
17 EXTRA_DIST = \
18         aMule.xpm \
19         LibSocketAsio.cpp \
20         LibSocketWX.cpp \
21         Parser.y \
22         Scanner.h.in \
23         Scanner.l \
24         IPFilterScanner.l \
25         muuli.wdr
27 bin_PROGRAMS =
29 if MONOLITHIC
30 bin_PROGRAMS += amule
31 endif
33 if COMPILE_CMD
34 bin_PROGRAMS += amulecmd
35 endif
37 if ED2K
38 bin_PROGRAMS += ed2k
39 endif
41 if AMULE_GUI
42 bin_PROGRAMS += amulegui
43 endif
45 if AMULE_DAEMON
46 bin_PROGRAMS += amuled
47 endif
49 # Sources
50 noinst_LIBRARIES = libmulesocket.a
51 if MONOLITHIC
52 noinst_LIBRARIES += libmuleappcore.a libmuleappgui.a libmuleappcommon.a
53 else
54 if AMULE_DAEMON
55 noinst_LIBRARIES += libmuleappcore.a libmuleappcommon.a
56 else
57 if AMULE_GUI
58 noinst_LIBRARIES += libmuleappgui.a libmuleappcommon.a
59 endif
60 endif
61 endif
64 # Socket lib (WX or Asio)
66 libmulesocket_a_SOURCES = LibSocket.cpp
67 libmulesocket_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(BOOST_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
70 # Common to core/gui/monolithic
72 libmuleappcommon_a_SOURCES = \
73         CFile.cpp \
74         ClientCredits.cpp \
75         DataToText.cpp \
76         ED2KLink.cpp \
77         Friend.cpp \
78         GapList.cpp \
79         MagnetURI.cpp \
80         MemFile.cpp \
81         NetworkFunctions.cpp \
82         OtherFunctions.cpp \
83         Packet.cpp \
84         RLE.cpp \
85         SafeFile.cpp \
86         SHA.cpp \
87         Tag.cpp \
88         TerminationProcess.cpp \
89         Timer.cpp \
90         kademlia/utils/UInt128.cpp
92 libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
95 # Common to core/monolithic
97 libmuleappcore_a_SOURCES = \
98         AsyncDNS.cpp \
99         CanceledFileList.cpp \
100         DeadSourceList.cpp \
101         FileArea.cpp \
102         FileAutoClose.cpp \
103         IPFilterScanner.cpp \
104         Scanner.cpp \
105         Parser.cpp \
106         PlatformSpecific.cpp \
107         RandomFunctions.cpp \
108         RC4Encrypt.cpp \
109         StateMachine.cpp \
110         TerminationProcessAmuleweb.cpp \
111         ThreadScheduler.cpp \
112         UPnPBase.cpp \
113         kademlia/kademlia/Entry.cpp \
114         kademlia/kademlia/Indexed.cpp \
115         kademlia/kademlia/SearchManager.cpp \
116         kademlia/routing/RoutingBin.cpp
118 libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
121 # Common to gui/monolithic
123 libmuleappgui_a_SOURCES = \
124         BarShader.cpp \
125         ColorFrameCtrl.cpp \
126         EditServerListDlg.cpp \
127         extern/wxWidgets/listctrl.cpp \
128         FileDetailListCtrl.cpp \
129         IP2Country.cpp \
130         MuleColour.cpp \
131         MuleGifCtrl.cpp \
132         MuleListCtrl.cpp \
133         MuleNotebook.cpp \
134         MuleTextCtrl.cpp \
135         MuleCollection.cpp \
136         muuli_wdr.cpp
138 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS) $(GEOIP_CPPFLAGS)
140 core_sources = \
141         amule.cpp \
142         BaseClient.cpp \
143         ClientList.cpp \
144         ClientCreditsList.cpp \
145         ClientTCPSocket.cpp \
146         ClientUDPSocket.cpp \
147         CorruptionBlackBox.cpp \
148         DownloadClient.cpp \
149         DownloadQueue.cpp \
150         ECSpecialCoreTags.cpp \
151         EMSocket.cpp \
152         EncryptedStreamSocket.cpp \
153         EncryptedDatagramSocket.cpp \
154         ExternalConn.cpp \
155         FriendList.cpp \
156         IPFilter.cpp \
157         KnownFileList.cpp \
158         ListenSocket.cpp \
159         MuleUDPSocket.cpp \
160         SearchFile.cpp \
161         SearchList.cpp \
162         ServerConnect.cpp \
163         ServerList.cpp \
164         ServerSocket.cpp \
165         ServerUDPSocket.cpp \
166         SHAHashSet.cpp \
167         SharedFileList.cpp \
168         ThreadTasks.cpp \
169         UploadBandwidthThrottler.cpp \
170         UploadClient.cpp \
171         UploadQueue.cpp \
172         kademlia/kademlia/Kademlia.cpp \
173         kademlia/kademlia/Prefs.cpp \
174         kademlia/kademlia/Search.cpp \
175         kademlia/kademlia/UDPFirewallTester.cpp \
176         kademlia/net/KademliaUDPListener.cpp \
177         kademlia/net/PacketTracking.cpp \
178         kademlia/routing/Contact.cpp \
179         kademlia/routing/RoutingZone.cpp
182 gui_sources = \
183         amule-gui.cpp \
184         amuleDlg.cpp \
185         AddFriend.cpp \
186         CatDialog.cpp \
187         ChatSelector.cpp \
188         ChatWnd.cpp \
189         CommentDialog.cpp \
190         CommentDialogLst.cpp \
191         GenericClientListCtrl.cpp \
192         ClientDetailDialog.cpp \
193         DirectoryTreeCtrl.cpp \
194         FileDetailDialog.cpp \
195         KadDlg.cpp \
196         OScopeCtrl.cpp \
197         PrefsUnifiedDlg.cpp \
198         SearchDlg.cpp \
199         ServerWnd.cpp \
200         SharedFilesWnd.cpp \
201         StatisticsDlg.cpp \
202         SearchListCtrl.cpp \
203         DownloadListCtrl.cpp \
204         SourceListCtrl.cpp \
205         SharedFilePeersListCtrl.cpp \
206         FriendListCtrl.cpp \
207         ServerListCtrl.cpp \
208         SharedFilesCtrl.cpp \
209         MuleTrayIcon.cpp \
210         TransferWnd.cpp
213 common_sources = \
214         amuleAppCommon.cpp \
215         ClientRef.cpp \
216         ECSpecialMuleTags.cpp \
217         KnownFile.cpp \
218         GetTickCount.cpp \
219         GuiEvents.cpp \
220         HTTPDownload.cpp \
221         Logger.cpp \
222         PartFile.cpp \
223         Preferences.cpp \
224         Proxy.cpp \
225         Server.cpp \
226         Statistics.cpp \
227         StatTree.cpp \
228         UserEvents.cpp
230 # Libs
232 core_libs = -L. -lmuleappcore $(LIBUPNP_LDFLAGS) $(LIBUPNP_LIBS)
233 gui_libs = -L. -lmuleappgui $(WX_LIBS) $(GEOIP_LDFLAGS) $(GEOIP_LIBS)
234 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
235 common_libs = -L. -lmuleappcommon $(remote_common_libs) -lmulesocket $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) $(CRYPTOPP_LDFLAGS) $(CRYPTOPP_LIBS)
237 core_deps = libmuleappcore.a
238 gui_deps = libmuleappgui.a
239 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
240 common_deps = libmuleappcommon.a $(remote_common_deps) libmulesocket.a
242 if SYS_WIN32
243 core_libs += -lshlwapi
244 endif
247 # Flags
249 core_flags = $(BOOST_CPPFLAGS) $(LIBUPNP_CPPFLAGS) $(LIBUPNP_CFLAGS)
250 gui_flags = $(WX_CPPFLAGS) $(GEOIP_CPPFLAGS)
251 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS)
253 # --------- Apps ---------
255 amulegui_SOURCES = \
256         amule-remote-gui.cpp \
257         $(gui_sources) \
258         $(ec_sources) \
259         $(common_sources)
261 amule_SOURCES = \
262         CaptchaDialog.cpp \
263         CaptchaGenerator.cpp \
264         PartFileConvert.cpp \
265         PartFileConvertDlg.cpp \
266         $(core_sources) \
267         $(gui_sources) \
268         $(ec_sources) \
269         $(common_sources)
271 amuled_SOURCES = \
272         amuled.cpp \
273         $(core_sources) \
274         $(ec_sources) \
275         $(common_sources)
277 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
278 amule_CPPFLAGS = $(AM_CPPFLAGS) $(core_flags) $(gui_flags) $(common_flags)
279 amule_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CPPFLAGS_ONLY)
280 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
282 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
283 amulegui_CPPFLAGS = $(AM_CPPFLAGS) $(gui_flags) $(common_flags) -DCLIENT_GUI
284 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
285 amulegui_LDADD = $(common_libs) $(gui_libs)
287 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
288 amuled_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON
289 amuled_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
290 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
292 ed2k_SOURCES = \
293         ED2KLinkParser.cpp \
294         MagnetURI.cpp \
295         MuleCollection.cpp
297 ed2k_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_STD_STRING
299 # on Win32
300 if SYS_WIN32
301 ed2k_LDADD = -lshlwapi
302 endif
303 # on Mac
304 if NEED_CORESERVICES
305 ed2k_LDFLAGS = $(AM_LDFLAGS) -framework CoreServices
306 endif
308 amulecmd_SOURCES = \
309         TextClient.cpp \
310         DataToText.cpp \
311         ExternalConnector.cpp \
312         LoggerConsole.cpp \
313         OtherFunctions.cpp \
314         NetworkFunctions.cpp
316 amulecmd_DEPENDENCIES = $(remote_common_deps) libmulesocket.a
317 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags)
318 amulecmd_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
319 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
320 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -L. -lmulecommon -lec -lmulesocket \
321         $(WXBASE_LIBS) $(READLINE_LIBS) $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS)
323 noinst_HEADERS = \
324                 AddFriend.h \
325                 AsyncDNS.h \
326                 amule-remote-gui.h \
327                 amuleDlg.h \
328                 amule.h \
329                 amuleIPV4Address.h \
330                 ArchSpecific.h \
331                 BarShader.h \
332                 BitVector.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                 ClientList.h \
344                 ClientRef.h \
345                 ClientTCPSocket.h \
346                 ClientUDPSocket.h \
347                 ColorFrameCtrl.h \
348                 CommentDialog.h \
349                 CommentDialogLst.h \
350                 CompilerSpecific.h \
351                 Constants.h \
352                 CorruptionBlackBox.h \
353                 CryptoPP_Inc.h \
354                 DataToText.h \
355                 DeadSourceList.h \
356                 DirectoryTreeCtrl.h \
357                 DownloadListCtrl.h \
358                 DownloadQueue.h \
359                 ED2KLink.h \
360                 EditServerListDlg.h \
361                 EMSocket.h \
362                 EncryptedDatagramSocket.h \
363                 EncryptedStreamSocket.h \
364                 ExternalConnector.h \
365                 ExternalConn.h \
366                 FileArea.h \
367                 FileAutoClose.h \
368                 FileDetailDialog.h \
369                 FileDetailListCtrl.h \
370                 FileLock.h \
371                 Friend.h \
372                 FriendListCtrl.h \
373                 FriendList.h \
374                 GapList.h \
375                 GetTickCount.h \
376                 GenericClientListCtrl.h \
377                 GuiEvents.h \
378                 HTTPDownload.h \
379                 inetdownload.h \
380                 InternalEvents.h \
381                 IP2Country.h \
382                 IPFilter.h \
383                 IPFilterScanner.h \
384                 KadDlg.h \
385                 KnownFile.h \
386                 KnownFileList.h \
387                 LibSocket.h \
388                 ListenSocket.h \
389                 Logger.h \
390                 MagnetURI.h \
391                 MD4Hash.h \
392                 MemFile.h \
393                 MuleCollection.h \
394                 MuleColour.h \
395                 MuleGifCtrl.h \
396                 MuleListCtrl.h \
397                 MuleNotebook.h \
398                 MuleTextCtrl.h \
399                 MuleThread.h \
400                 MuleTrayIcon.h \
401                 MuleUDPSocket.h \
402                 MuleVersion.h \
403                 muuli_wdr.h \
404                 NetworkFunctions.h \
405                 OScopeCtrl.h \
406                 Observable.h \
407                 ObservableQueue.h \
408                 OtherFunctions.h \
409                 OtherStructs.h \
410                 Packet.h \
411                 Parser.hpp \
412                 PartFileConvert.h \
413                 PartFileConvertDlg.h \
414                 PartFile.h \
415                 PlatformSpecific.h \
416                 Preferences.h \
417                 PrefsUnifiedDlg.h \
418                 Proxy.h \
419                 RangeMap.h \
420                 RC4Encrypt.h \
421                 RLE.h \
422                 RandomFunctions.h \
423                 SafeFile.h \
424                 Scanner.h \
425                 ScopedPtr.h \
426                 SearchDlg.h \
427                 SearchExpr.h \
428                 SearchFile.h \
429                 SearchListCtrl.h \
430                 SearchList.h \
431                 ServerConnect.h \
432                 Server.h \
433                 ServerListCtrl.h \
434                 ServerList.h \
435                 ServerSocket.h \
436                 ServerUDPSocket.h \
437                 ServerWnd.h \
438                 SHA.h \
439                 SHAHashSet.h \
440                 SharedFileList.h \
441                 SharedFilePeersListCtrl.h \
442                 SharedFilesCtrl.h \
443                 SharedFilesWnd.h \
444                 SourceListCtrl.h \
445                 StateMachine.h \
446                 StatisticsDlg.h \
447                 Statistics.h \
448                 StatTree.h \
449                 Tag.h \
450                 TerminationProcess.h \
451                 TerminationProcessAmuleweb.h \
452                 TextClient.h \
453                 ThreadScheduler.h \
454                 ThreadTasks.h \
455                 ThrottledSocket.h \
456                 Timer.h \
457                 TransferWnd.h \
458                 Types.h \
459                 updownclient.h \
460                 UpDownClientEC.h \
461                 UploadBandwidthThrottler.h \
462                 UploadQueue.h \
463                 UPnPBase.h \
464                 UPnPCompatibility.h \
465                 UserEvents.h \
466                 extern/wxWidgets/listctrl.h
468 MAINTAINERCLEANFILES = Makefile.in
470 $(srcdir)/Parser.cpp: Parser.y
471         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
473 if GENERATE_FLEX_HEADER
474 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
475                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
476 else
477 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
478                 $(LEX) -o $@ $(srcdir)/Scanner.l; \
479                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
480 endif
481 $(srcdir)/Scanner.h: $(srcdir)/Scanner.cpp
483 $(srcdir)/IPFilterScanner.cpp: IPFilterScanner.l
484                 $(LEX) -Pyyip -o $@ $(srcdir)/IPFilterScanner.l;
486 # Resources
488 if NEED_RC
490 SUFFIXES = .rc
492 .rc.$(OBJEXT):
493         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
495 nodist_amuled_SOURCES = amuled-version.rc
496 nodist_amulecmd_SOURCES = amulecmd-version.rc
497 nodist_ed2k_SOURCES = ed2k-version.rc
498 amule_LDADD += amulerc.$(OBJEXT)
499 amule_DEPENDENCIES += amulerc.$(OBJEXT)
500 amulegui_LDADD += amuleguirc.$(OBJEXT)
501 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
503 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
504         cat $^ | \
505         ( \
506                 abs_builddir=`pwd` ; \
507                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
508                 cd $(<D) ; \
509                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
510         )
512 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
513         cat $^ | \
514         ( \
515                 abs_builddir=`pwd` ; \
516                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
517                 cd $(<D) ; \
518                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
519         )
521 amule-version.rc: $(top_builddir)/version.rc
522         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
523              -e 's/VER_INTERNALNAME_STR/"amule"/' \
524              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
526 amuled-version.rc: $(top_builddir)/version.rc
527         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
528              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
529              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
531 amulecmd-version.rc: $(top_builddir)/version.rc
532         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
533              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
534              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
536 amulegui-version.rc: $(top_builddir)/version.rc
537         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
538              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
539              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
541 ed2k-version.rc: $(top_builddir)/version.rc
542         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
543              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
544              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
546 CLEANFILES = *-version.rc
548 endif
551 EXTRA__DIST__SUBDIRS = include kademlia
552 include $(top_srcdir)/automake/dist-hook.am