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