Upstream tarball 9590
[amule.git] / src / Makefile.am
blob6025c33809340c2931b12cd1e93e697040f7d174
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 \
75         RandomFunctions.cpp \
76         kademlia/utils/UInt128.cpp
78 libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
81 # Common to core/monolithic
83 libmuleappcore_a_SOURCES = \
84         AsyncDNS.cpp \
85         DeadSourceList.cpp \
86         FileArea.cpp \
87         FileAutoClose.cpp \
88         Scanner.cpp \
89         Parser.cpp \
90         PlatformSpecific.cpp \
91         kademlia/kademlia/Entry.cpp \
92         kademlia/kademlia/SearchManager.cpp \
93         kademlia/routing/RoutingBin.cpp \
94         StateMachine.cpp \
95         ThreadScheduler.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         DirectoryTreeCtrl.cpp \
109         EditServerListDlg.cpp \
110         extern/wxWidgets/listctrl.cpp \
111         FileDetailListCtrl.cpp \
112         MuleGifCtrl.cpp \
113         MuleListCtrl.cpp \
114         MuleNotebook.cpp \
115         MuleTextCtrl.cpp \
116         MuleCollection.cpp \
117         muuli_wdr.cpp 
119 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS) $(GEOIP_CPPFLAGS)
121 core_sources = \
122         RC4Encrypt.cpp \
123         amule.cpp \
124         BaseClient.cpp \
125         ClientList.cpp \
126         ClientCreditsList.cpp \
127         ClientTCPSocket.cpp \
128         ClientUDPSocket.cpp \
129         CorruptionBlackBox.cpp \
130         DownloadClient.cpp \
131         DownloadQueue.cpp \
132         ECSpecialCoreTags.cpp \
133         EMSocket.cpp \
134         EncryptedStreamSocket.cpp \
135         EncryptedDatagramSocket.cpp \
136         ExternalConn.cpp \
137         Friend.cpp \
138         FriendList.cpp \
139         HTTPDownload.cpp \
140         IPFilter.cpp \
141         KnownFileList.cpp \
142         ListenSocket.cpp \
143         MuleUDPSocket.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         FileDetailDialog.cpp \
178         KadDlg.cpp \
179         OScopeCtrl.cpp \
180         PartFileConvert.cpp \
181         PrefsUnifiedDlg.cpp \
182         SearchDlg.cpp \
183         ServerWnd.cpp \
184         SharedFilesWnd.cpp \
185         StatisticsDlg.cpp \
186         SearchListCtrl.cpp \
187         DownloadListCtrl.cpp \
188         ClientListCtrl.cpp \
189         FriendListCtrl.cpp \
190         ServerListCtrl.cpp \
191         SharedFilesCtrl.cpp \
192         MuleTrayIcon.cpp \
193         MuleColour.cpp \
194         TransferWnd.cpp 
196 if ENABLE_IP2COUNTRY
197 gui_sources += \
198         IP2Country.cpp
199 endif
202 remote_common_sources = \
203         OtherFunctions.cpp \
204         NetworkFunctions.cpp 
206 common_sources = \
207         ClientCredits.cpp \
208         ECSpecialMuleTags.cpp \
209         KnownFile.cpp \
210         GapList.cpp \
211         GetTickCount.cpp \
212         GuiEvents.cpp \
213         Logger.cpp \
214         PartFile.cpp \
215         Preferences.cpp \
216         Proxy.cpp \
217         Server.cpp \
218         Statistics.cpp \
219         StatTree.cpp \
220         SHAHashSet.cpp \
221         TerminationProcess.cpp \
222         TerminationProcessAmuleweb.cpp \
223         UserEvents.cpp \
224         $(remote_common_sources)
226 # Libs
228 core_libs = -L. -lmuleappcore $(LIBUPNP_LDFLAGS) $(LIBUPNP_LIBS)
229 gui_libs = -L. -lmuleappgui $(X11LIBS) $(WX_LIBS) $(GEOIP_LDFLAGS) $(GEOIP_LIBS)
230 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
231 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOPP_LDFLAGS) $(CRYPTOPP_LIBS)
233 core_deps = libmuleappcore.a
234 gui_deps = libmuleappgui.a
235 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
236 common_deps = libmuleappcommon.a $(remote_common_deps)
238 if SYS_WIN32
239 core_libs += -lshlwapi
240 endif
243 # Flags
245 core_flags = $(LIBUPNP_CPPFLAGS) $(LIBUPNP_CFLAGS)
246 gui_flags = $(WX_CPPFLAGS) $(GEOIP_CPPFLAGS)
247 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS)
249 # --------- Apps ---------
251 amulegui_SOURCES = \
252         amule-remote-gui.cpp \
253         $(gui_sources) \
254         $(ec_sources) \
255         $(common_sources)
257 if ENABLE_IP2COUNTRY
258 amulegui_SOURCES += \
259         HTTPDownload.cpp
260 endif
262 amule_SOURCES = \
263         CaptchaDialog.cpp \
264         CaptchaGenerator.cpp \
265         $(core_sources) \
266         $(gui_sources) \
267         $(ec_sources) \
268         $(common_sources)
270 amuled_SOURCES = \
271         amuled.cpp \
272         Timer.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 -DEC_REMOTE
284 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
285 amulegui_LDADD = $(gui_libs) $(common_libs) $(WXBASE_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         ExternalConnector.cpp \
311         $(remote_common_sources)
313 amulecmd_DEPENDENCIES = $(remote_common_deps)
314 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
315 amulecmd_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
316 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
317 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
318         $(WXBASE_LIBS) $(READLINE_LIBS) $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
320 noinst_HEADERS = \
321                 AddFriend.h \
322                 AsyncDNS.h \
323                 amule-remote-gui.h \
324                 amuleDlg.h \
325                 amule.h \
326                 amuleIPV4Address.h \
327                 ArchSpecific.h \
328                 BarShader.h \
329                 CaptchaDialog.h \
330                 CaptchaGenerator.h \
331                 CatDialog.h \
332                 CFile.h \
333                 ChatSelector.h \
334                 ChatWnd.h \
335                 ClientCredits.h \
336                 ClientCreditsList.h \
337                 ClientDetailDialog.h \
338                 ClientListCtrl.h \
339                 ClientList.h \
340                 ClientTCPSocket.h \
341                 ClientUDPSocket.h \
342                 ColorFrameCtrl.h \
343                 CommentDialog.h \
344                 CommentDialogLst.h \
345                 Constants.h \
346                 CorruptionBlackBox.h \
347                 CryptoPP_Inc.h \
348                 DataToText.h \
349                 DeadSourceList.h \
350                 DirectoryTreeCtrl.h \
351                 DownloadListCtrl.h \
352                 DownloadQueue.h \
353                 ED2KLink.h \
354                 EditServerListDlg.h \
355                 EMSocket.h \
356                 EncryptedDatagramSocket.h \
357                 EncryptedStreamSocket.h \
358                 ExternalConnector.h \
359                 ExternalConn.h \
360                 FileArea.h \
361                 FileAutoClose.h \
362                 FileDetailDialog.h \
363                 FileDetailListCtrl.h \
364                 FileLock.h \
365                 Friend.h \
366                 FriendListCtrl.h \
367                 FriendList.h \
368                 GapList.h \
369                 GetTickCount.h \
370                 GuiEvents.h \
371                 HTTPDownload.h \
372                 inetdownload.h \
373                 InternalEvents.h \
374                 IP2Country.h \
375                 IPFilter.h \
376                 KadDlg.h \
377                 KnownFile.h \
378                 KnownFileList.h \
379                 ListenSocket.h \
380                 Logger.h \
381                 MagnetURI.h \
382                 MD4Hash.h \
383                 MemFile.h \
384                 MuleCollection.h \
385                 MuleColour.h \
386                 MuleGifCtrl.h \
387                 MuleListCtrl.h \
388                 MuleNotebook.h \
389                 MuleTextCtrl.h \
390                 MuleThread.h \
391                 MuleTrayIcon.h \
392                 MuleUDPSocket.h \
393                 muuli_wdr.h \
394                 NetworkFunctions.h \
395                 OScopeCtrl.h \
396                 Observable.h \
397                 ObservableQueue.h \
398                 OtherFunctions.h \
399                 OtherStructs.h \
400                 Packet.h \
401                 Parser.hpp \
402                 PartFileConvert.h \
403                 PartFile.h \
404                 PlatformSpecific.h \
405                 Preferences.h \
406                 PrefsUnifiedDlg.h \
407                 Proxy.h \
408                 RangeMap.h \
409                 RC4Encrypt.h \
410                 RLE.h \
411                 RandomFunctions.h \
412                 SafeFile.h \
413                 Scanner.h \
414                 ScopedPtr.h \
415                 SearchDlg.h \
416                 SearchExpr.h \
417                 SearchFile.h \
418                 SearchListCtrl.h \
419                 SearchList.h \
420                 ServerConnect.h \
421                 Server.h \
422                 ServerListCtrl.h \
423                 ServerList.h \
424                 ServerSocket.h \
425                 ServerUDPSocket.h \
426                 ServerWnd.h \
427                 SHA.h \
428                 SHAHashSet.h \
429                 SharedFileList.h \
430                 SharedFilesCtrl.h \
431                 SharedFilesWnd.h \
432                 StateMachine.h \
433                 StatisticsDlg.h \
434                 Statistics.h \
435                 StatTree.h \
436                 Tag.h \
437                 TerminationProcess.h \
438                 TerminationProcessAmuleweb.h \
439                 TextClient.h \
440                 ThreadScheduler.h \
441                 ThreadTasks.h \
442                 ThrottledSocket.h \
443                 Timer.h \
444                 TransferWnd.h \
445                 Types.h \
446                 updownclient.h \
447                 UploadBandwidthThrottler.h \
448                 UploadQueue.h \
449                 UPnPBase.h \
450                 UPnPCompatibility.h \
451                 UserEvents.h \
452                 extern/wxWidgets/listctrl.h
454 MAINTAINERCLEANFILES = Makefile.in
456 $(srcdir)/Parser.cpp: Parser.y
457         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
459 if GENERATE_FLEX_HEADER
460 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
461                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
462 else
463 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
464                 $(LEX) -o$@ $(srcdir)/Scanner.l; \
465                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
466 endif
468 # Resources
470 if NEED_RC
472 SUFFIXES = .rc
474 .rc.$(OBJEXT):
475         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
477 nodist_amuled_SOURCES = amuled-version.rc
478 nodist_amulecmd_SOURCES = amulecmd-version.rc
479 nodist_ed2k_SOURCES = ed2k-version.rc
480 amule_LDADD += amulerc.$(OBJEXT)
481 amule_DEPENDENCIES += amulerc.$(OBJEXT)
482 amulegui_LDADD += amuleguirc.$(OBJEXT)
483 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
485 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
486         cat $^ | \
487         ( \
488                 abs_builddir=`pwd` ; \
489                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
490                 cd $(<D) ; \
491                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
492         )
494 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
495         cat $^ | \
496         ( \
497                 abs_builddir=`pwd` ; \
498                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
499                 cd $(<D) ; \
500                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
501         )
503 amule-version.rc: $(top_builddir)/version.rc
504         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
505              -e 's/VER_INTERNALNAME_STR/"amule"/' \
506              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
508 amuled-version.rc: $(top_builddir)/version.rc
509         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
510              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
511              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
513 amulecmd-version.rc: $(top_builddir)/version.rc
514         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
515              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
516              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
518 amulegui-version.rc: $(top_builddir)/version.rc
519         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
520              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
521              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
523 ed2k-version.rc: $(top_builddir)/version.rc
524         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
525              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
526              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
528 CLEANFILES = *-version.rc
530 endif
533 EXTRA__DIST__SUBDIRS = include kademlia remote-gui.net
534 include $(top_srcdir)/automake/dist-hook.am