Rework friends for EC
[amule.git] / src / Makefile.am
blob6154c9a07c6a55b3bedaf10ee3bd70c0f4b5ac57
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         IPFilterScanner.l \
22         muuli.wdr 
24 bin_PROGRAMS = 
26 if MONOLITHIC
27 bin_PROGRAMS += amule
28 endif
30 if COMPILE_CMD
31 bin_PROGRAMS += amulecmd   
32 endif
34 if ED2K
35 bin_PROGRAMS += ed2k
36 endif
38 if AMULE_GUI
39 bin_PROGRAMS += amulegui
40 endif
42 if AMULE_DAEMON
43 bin_PROGRAMS += amuled
44 endif
46 # Sources
47 noinst_LIBRARIES =
48 if MONOLITHIC
49 noinst_LIBRARIES += libmuleappcore.a libmuleappgui.a libmuleappcommon.a
50 else
51 if AMULE_DAEMON
52 noinst_LIBRARIES += libmuleappcore.a libmuleappcommon.a
53 else
54 if AMULE_GUI
55 noinst_LIBRARIES += libmuleappgui.a libmuleappcommon.a
56 endif
57 endif
58 endif
61 # Common to core/gui/monolithic
63 libmuleappcommon_a_SOURCES = \
64         CFile.cpp \
65         ClientCredits.cpp \
66         ED2KLink.cpp \
67         GapList.cpp \
68         MagnetURI.cpp \
69         MemFile.cpp \
70         NetworkFunctions.cpp \
71         OtherFunctions.cpp \
72         Packet.cpp \
73         RLE.cpp \
74         SafeFile.cpp \
75         SHA.cpp \
76         Tag.cpp \
77         TerminationProcess.cpp \
78         Timer.cpp
80 libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
83 # Common to core/monolithic
85 libmuleappcore_a_SOURCES = \
86         AsyncDNS.cpp \
87         DeadSourceList.cpp \
88         FileArea.cpp \
89         FileAutoClose.cpp \
90         IPFilterScanner.cpp \
91         Scanner.cpp \
92         Parser.cpp \
93         PlatformSpecific.cpp \
94         RandomFunctions.cpp \
95         RC4Encrypt.cpp \
96         StateMachine.cpp \
97         TerminationProcessAmuleweb.cpp \
98         ThreadScheduler.cpp \
99         UPnPBase.cpp \
100         kademlia/kademlia/Entry.cpp \
101         kademlia/kademlia/SearchManager.cpp \
102         kademlia/routing/RoutingBin.cpp \
103         kademlia/utils/UInt128.cpp
105 libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
108 # Common to gui/monolithic
110 libmuleappgui_a_SOURCES = \
111         BarShader.cpp \
112         ColorFrameCtrl.cpp \
113         EditServerListDlg.cpp \
114         extern/wxWidgets/listctrl.cpp \
115         FileDetailListCtrl.cpp \
116         IP2Country.cpp \
117         MuleColour.cpp \
118         MuleGifCtrl.cpp \
119         MuleListCtrl.cpp \
120         MuleNotebook.cpp \
121         MuleTextCtrl.cpp \
122         MuleCollection.cpp \
123         muuli_wdr.cpp 
125 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS) $(GEOIP_CPPFLAGS)
127 core_sources = \
128         amule.cpp \
129         BaseClient.cpp \
130         CanceledFileList.cpp \
131         ClientList.cpp \
132         ClientCreditsList.cpp \
133         ClientTCPSocket.cpp \
134         ClientUDPSocket.cpp \
135         CorruptionBlackBox.cpp \
136         DownloadClient.cpp \
137         DownloadQueue.cpp \
138         ECSpecialCoreTags.cpp \
139         EMSocket.cpp \
140         EncryptedStreamSocket.cpp \
141         EncryptedDatagramSocket.cpp \
142         ExternalConn.cpp \
143         FriendList.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         ThreadTasks.cpp \
157         UploadBandwidthThrottler.cpp \
158         UploadClient.cpp \
159         UploadQueue.cpp \
160         kademlia/kademlia/Indexed.cpp \
161         kademlia/kademlia/Kademlia.cpp \
162         kademlia/kademlia/Prefs.cpp \
163         kademlia/kademlia/Search.cpp \
164         kademlia/kademlia/UDPFirewallTester.cpp \
165         kademlia/net/KademliaUDPListener.cpp \
166         kademlia/net/PacketTracking.cpp \
167         kademlia/routing/Contact.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         ChatWnd.cpp \
178         CommentDialog.cpp \
179         CommentDialogLst.cpp \
180         GenericClientListCtrl.cpp \
181         ClientDetailDialog.cpp \
182         DirectoryTreeCtrl.cpp \
183         FileDetailDialog.cpp \
184         KadDlg.cpp \
185         OScopeCtrl.cpp \
186         PartFileConvertDlg.cpp \
187         PrefsUnifiedDlg.cpp \
188         SearchDlg.cpp \
189         ServerWnd.cpp \
190         SharedFilesWnd.cpp \
191         StatisticsDlg.cpp \
192         SearchListCtrl.cpp \
193         DownloadListCtrl.cpp \
194         SourceListCtrl.cpp \
195         SharedFilePeersListCtrl.cpp \
196         FriendListCtrl.cpp \
197         ServerListCtrl.cpp \
198         SharedFilesCtrl.cpp \
199         MuleTrayIcon.cpp \
200         TransferWnd.cpp 
203 common_sources = \
204         amuleAppCommon.cpp \
205         DataToText.cpp \
206         ECSpecialMuleTags.cpp \
207         Friend.cpp \
208         KnownFile.cpp \
209         GetTickCount.cpp \
210         GuiEvents.cpp \
211         HTTPDownload.cpp \
212         Logger.cpp \
213         PartFile.cpp \
214         Preferences.cpp \
215         Proxy.cpp \
216         Server.cpp \
217         Statistics.cpp \
218         StatTree.cpp \
219         SHAHashSet.cpp \
220         UserEvents.cpp
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         $(gui_sources) \
250         $(ec_sources) \
251         $(common_sources)
253 amule_SOURCES = \
254         CaptchaDialog.cpp \
255         CaptchaGenerator.cpp \
256         $(core_sources) \
257         $(gui_sources) \
258         $(ec_sources) \
259         $(common_sources)
261 amuled_SOURCES = \
262         amuled.cpp \
263         $(core_sources) \
264         $(ec_sources) \
265         $(common_sources)
267 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
268 amule_CPPFLAGS = $(AM_CPPFLAGS) $(core_flags) $(gui_flags) $(common_flags)
269 amule_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CPPFLAGS_ONLY)
270 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
272 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
273 amulegui_CPPFLAGS = $(AM_CPPFLAGS) $(gui_flags) $(common_flags) -DCLIENT_GUI
274 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
275 amulegui_LDADD = $(gui_libs) $(common_libs) $(WXBASE_LIBS)
277 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
278 amuled_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
279 amuled_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
280 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
282 ed2k_SOURCES = \
283         ED2KLinkParser.cpp \
284         MagnetURI.cpp \
285         MuleCollection.cpp      
287 ed2k_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_STD_STRING
289 # on Win32
290 if SYS_WIN32
291 ed2k_LDADD = -lshlwapi
292 endif
293 # on Mac
294 if NEED_CORESERVICES
295 ed2k_LDFLAGS = $(AM_LDFLAGS) -framework CoreServices
296 endif
298 amulecmd_SOURCES = \
299         TextClient.cpp \
300         ExternalConnector.cpp \
301         LoggerConsole.cpp \
302         OtherFunctions.cpp \
303         NetworkFunctions.cpp 
305 amulecmd_DEPENDENCIES = $(remote_common_deps)
306 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags)
307 amulecmd_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
308 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
309 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
310         $(WXBASE_LIBS) $(READLINE_LIBS) $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
312 noinst_HEADERS = \
313                 AddFriend.h \
314                 AsyncDNS.h \
315                 amule-remote-gui.h \
316                 amuleDlg.h \
317                 amule.h \
318                 amuleIPV4Address.h \
319                 ArchSpecific.h \
320                 BarShader.h \
321                 BitVector.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                 SharedFilePeersListCtrl.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                 GenericClientListCtrl.h \
365                 GuiEvents.h \
366                 HTTPDownload.h \
367                 inetdownload.h \
368                 InternalEvents.h \
369                 IP2Country.h \
370                 IPFilter.h \
371                 IPFilterScanner.h \
372                 KadDlg.h \
373                 KnownFile.h \
374                 KnownFileList.h \
375                 ListenSocket.h \
376                 Logger.h \
377                 MagnetURI.h \
378                 MD4Hash.h \
379                 MemFile.h \
380                 MuleCollection.h \
381                 MuleColour.h \
382                 MuleGifCtrl.h \
383                 MuleListCtrl.h \
384                 MuleNotebook.h \
385                 MuleTextCtrl.h \
386                 MuleThread.h \
387                 MuleTrayIcon.h \
388                 MuleUDPSocket.h \
389                 muuli_wdr.h \
390                 NetworkFunctions.h \
391                 OScopeCtrl.h \
392                 Observable.h \
393                 ObservableQueue.h \
394                 OtherFunctions.h \
395                 OtherStructs.h \
396                 Packet.h \
397                 Parser.hpp \
398                 PartFileConvert.h \
399                 PartFileConvertDlg.h \
400                 PartFile.h \
401                 PlatformSpecific.h \
402                 Preferences.h \
403                 PrefsUnifiedDlg.h \
404                 Proxy.h \
405                 RangeMap.h \
406                 RC4Encrypt.h \
407                 RLE.h \
408                 RandomFunctions.h \
409                 SafeFile.h \
410                 Scanner.h \
411                 ScopedPtr.h \
412                 SearchDlg.h \
413                 SearchExpr.h \
414                 SearchFile.h \
415                 SearchListCtrl.h \
416                 SearchList.h \
417                 ServerConnect.h \
418                 Server.h \
419                 ServerListCtrl.h \
420                 ServerList.h \
421                 ServerSocket.h \
422                 ServerUDPSocket.h \
423                 ServerWnd.h \
424                 SHA.h \
425                 SHAHashSet.h \
426                 SharedFileList.h \
427                 SharedFilesCtrl.h \
428                 SharedFilesWnd.h \
429                 SourceListCtrl.h \
430                 StateMachine.h \
431                 StatisticsDlg.h \
432                 Statistics.h \
433                 StatTree.h \
434                 Tag.h \
435                 TerminationProcess.h \
436                 TerminationProcessAmuleweb.h \
437                 TextClient.h \
438                 ThreadScheduler.h \
439                 ThreadTasks.h \
440                 ThrottledSocket.h \
441                 Timer.h \
442                 TransferWnd.h \
443                 Types.h \
444                 updownclient.h \
445                 UploadBandwidthThrottler.h \
446                 UploadQueue.h \
447                 UPnPBase.h \
448                 UPnPCompatibility.h \
449                 UserEvents.h \
450                 extern/wxWidgets/listctrl.h
452 MAINTAINERCLEANFILES = Makefile.in
454 $(srcdir)/Parser.cpp: Parser.y
455         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
457 if GENERATE_FLEX_HEADER
458 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
459                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
460 else
461 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
462                 $(LEX) -o $@ $(srcdir)/Scanner.l; \
463                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
464 endif
466 $(srcdir)/IPFilterScanner.cpp: IPFilterScanner.l
467                 $(LEX) -Pyyip -o $@ $(srcdir)/IPFilterScanner.l;
469 # Resources
471 if NEED_RC
473 SUFFIXES = .rc
475 .rc.$(OBJEXT):
476         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
478 nodist_amuled_SOURCES = amuled-version.rc
479 nodist_amulecmd_SOURCES = amulecmd-version.rc
480 nodist_ed2k_SOURCES = ed2k-version.rc
481 amule_LDADD += amulerc.$(OBJEXT)
482 amule_DEPENDENCIES += amulerc.$(OBJEXT)
483 amulegui_LDADD += amuleguirc.$(OBJEXT)
484 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
486 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-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 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
496         cat $^ | \
497         ( \
498                 abs_builddir=`pwd` ; \
499                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
500                 cd $(<D) ; \
501                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
502         )
504 amule-version.rc: $(top_builddir)/version.rc
505         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
506              -e 's/VER_INTERNALNAME_STR/"amule"/' \
507              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
509 amuled-version.rc: $(top_builddir)/version.rc
510         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
511              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
512              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
514 amulecmd-version.rc: $(top_builddir)/version.rc
515         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
516              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
517              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
519 amulegui-version.rc: $(top_builddir)/version.rc
520         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
521              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
522              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
524 ed2k-version.rc: $(top_builddir)/version.rc
525         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
526              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
527              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
529 CLEANFILES = *-version.rc
531 endif
534 EXTRA__DIST__SUBDIRS = include kademlia
535 include $(top_srcdir)/automake/dist-hook.am