Upstream tarball 20080522
[amule.git] / src / Makefile.am
blobdf0938b67bd0b1083f41a01774edecbb4265381a
1 if WEB
2 OPT_WEB = webserver
3 endif
5 SUBDIRS = libs utils pixmaps skins $(OPT_WEB)
7 EXTRA_DIST = \
8         aMule.xpm \
9         Parser.y \
10         Scanner.h.in \
11         Scanner.l \
12         muuli.wdr 
14 bin_PROGRAMS = 
16 if MONOLITHIC
17 bin_PROGRAMS += amule
18 endif
20 if COMPILE_CMD
21 bin_PROGRAMS += amulecmd   
22 endif
24 if ED2K
25 bin_PROGRAMS += ed2k
26 endif
28 if AMULE_GUI
29 bin_PROGRAMS += amulegui
30 endif
32 if AMULE_DAEMON
33 bin_PROGRAMS += amuled
34 endif
36 # Sources
38 noinst_LIBRARIES = 
40 if MONOLITHIC
41 noinst_LIBRARIES += libmuleappcore.a    
42 else 
43 if AMULE_DAEMON
44 noinst_LIBRARIES += libmuleappcore.a
45 endif
46 endif
48 if MONOLITHIC
49 noinst_LIBRARIES += libmuleappgui.a
50 noinst_LIBRARIES += libmuleappcommon.a
51 else
52 if AMULE_GUI
53 noinst_LIBRARIES += libmuleappgui.a
54 noinst_LIBRARIES += libmuleappcommon.a
55 else
56 if AMULE_DAEMON
57 noinst_LIBRARIES += libmuleappcommon.a
58 endif
59 endif
60 endif
63 # Common to core/gui/monolithic
65 libmuleappcommon_a_SOURCES = \
66         CFile.cpp \
67         DataToText.cpp \
68         ED2KLink.cpp \
69         MagnetURI.cpp \
70         MemFile.cpp \
71         NetworkFunctions.cpp \
72         Packet.cpp \
73         RLE.cpp \
74         SafeFile.cpp \
75         SHA.cpp \
76         Tag.cpp \
77         Timer.cpp \
78         RandomFunctions.cpp \
79         kademlia/utils/UInt128.cpp
81 libmuleappcommon_a_CFLAGS = $(WXBASE_CFLAGS) -I$(srcdir)/libs -I$(srcdir)/include 
82 libmuleappcommon_a_CXXFLAGS = $(WXBASE_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
83 if ENABLE_UPNP
84 libmuleappcommon_a_CFLAGS += -DENABLE_UPNP=1
85 libmuleappcommon_a_CXXFLAGS += -DENABLE_UPNP=1
86 endif
89 # Common to core/monolithic
91 libmuleappcore_a_SOURCES = \
92         AsyncDNS.cpp \
93         DeadSourceList.cpp \
94         Scanner.cpp \
95         Parser.cpp \
96         PlatformSpecific.cpp \
97         kademlia/kademlia/Entry.cpp \
98         kademlia/kademlia/SearchManager.cpp \
99         kademlia/routing/RoutingBin.cpp \
100         StateMachine.cpp \
101         ThreadScheduler.cpp
103 libmuleappcore_a_CFLAGS = $(WXBASE_CFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
104 libmuleappcore_a_CXXFLAGS = $(WXBASE_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
105 if ENABLE_UPNP
106 libmuleappcore_a_CFLAGS += -DENABLE_UPNP=1
107 libmuleappcore_a_CXXFLAGS += -DENABLE_UPNP=1
108 endif
111 # Common to gui/monolithic
113 libmuleappgui_a_SOURCES = \
114         BarShader.cpp \
115         ChatWnd.cpp \
116         ColorFrameCtrl.cpp \
117         CommentDialog.cpp \
118         CommentDialogLst.cpp \
119         DirectoryTreeCtrl.cpp \
120         EditServerListDlg.cpp \
121         extern/wxWidgets/listctrl.cpp \
122         FileDetailListCtrl.cpp \
123         MuleGifCtrl.cpp \
124         MuleListCtrl.cpp \
125         MuleNotebook.cpp \
126         MuleTextCtrl.cpp \
127         MuleCollection.cpp \
128         muuli_wdr.cpp 
130 libmuleappgui_a_CFLAGS = $(WX_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
131 libmuleappgui_a_CXXFLAGS = $(WX_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
132 if ENABLE_UPNP
133 libmuleappgui_a_CFLAGS += -DENABLE_UPNP=1
134 libmuleappgui_a_CXXFLAGS += -DENABLE_UPNP=1
135 endif
137 core_sources = \
138         RC4Encrypt.cpp \
139         amule.cpp \
140         BaseClient.cpp \
141         ClientList.cpp \
142         ClientCreditsList.cpp \
143         ClientTCPSocket.cpp \
144         ClientUDPSocket.cpp \
145         DownloadClient.cpp \
146         DownloadQueue.cpp \
147         ECSpecialCoreTags.cpp \
148         EMSocket.cpp \
149         EncryptedStreamSocket.cpp \
150         EncryptedDatagramSocket.cpp \
151         ExternalConn.cpp \
152         Friend.cpp \
153         FriendList.cpp \
154         HTTPDownload.cpp \
155         IPFilter.cpp \
156         KnownFileList.cpp \
157         ListenSocket.cpp \
158         MuleUDPSocket.cpp \
159         SearchFile.cpp \
160         SearchList.cpp \
161         ServerConnect.cpp \
162         ServerList.cpp \
163         ServerSocket.cpp \
164         ServerUDPSocket.cpp \
165         SharedFileList.cpp \
166         ThreadTasks.cpp \
167         UploadBandwidthThrottler.cpp \
168         UploadClient.cpp \
169         UploadQueue.cpp \
170         kademlia/kademlia/Indexed.cpp \
171         kademlia/kademlia/Kademlia.cpp \
172         kademlia/kademlia/Prefs.cpp \
173         kademlia/kademlia/Search.cpp \
174         kademlia/kademlia/UDPFirewallTester.cpp \
175         kademlia/net/KademliaUDPListener.cpp \
176         kademlia/net/PacketTracking.cpp \
177         kademlia/routing/Contact.cpp \
178         kademlia/routing/RoutingZone.cpp
180 if ENABLE_UPNP
181 core_sources += \
182         UPnP.cpp \
183         UPnPCompatibility.cpp
184 endif
186 gui_sources = \
187         amule-gui.cpp \
188         amuleDlg.cpp \
189         AddFriend.cpp \
190         CatDialog.cpp \
191         ChatSelector.cpp \
192         ClientDetailDialog.cpp \
193         FileDetailDialog.cpp \
194         KadDlg.cpp \
195         OScopeCtrl.cpp \
196         PartFileConvert.cpp \
197         PrefsUnifiedDlg.cpp \
198         SearchDlg.cpp \
199         ServerWnd.cpp \
200         SharedFilesWnd.cpp \
201         StatisticsDlg.cpp \
202         SearchListCtrl.cpp \
203         DownloadListCtrl.cpp \
204         ClientListCtrl.cpp \
205         FriendListCtrl.cpp \
206         ServerListCtrl.cpp \
207         SharedFilesCtrl.cpp \
208         MuleTrayIcon.cpp \
209         TransferWnd.cpp 
211 if ENABLE_IP2COUNTRY
212 gui_sources += \
213         IP2Country.cpp
214 endif
217 remote_common_sources = \
218         OtherFunctions.cpp \
219         NetworkFunctions.cpp 
221 common_sources = \
222         ClientCredits.cpp \
223         ECSpecialMuleTags.cpp \
224         KnownFile.cpp \
225         GetTickCount.cpp \
226         GuiEvents.cpp \
227         Logger.cpp \
228         PartFile.cpp \
229         Preferences.cpp \
230         Proxy.cpp \
231         Server.cpp \
232         Statistics.cpp \
233         StatTree.cpp \
234         SHAHashSet.cpp \
235         TerminationProcess.cpp \
236         TerminationProcessAmuleweb.cpp \
237         UserEvents.cpp \
238         $(remote_common_sources)
240 # Libs
242 core_libs = -L. -lmuleappcore
243 gui_libs = -L. -lmuleappgui $(X11LIBS) $(WX_LIBS)
244 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(ZLIB_LIBS) $(RESOLV_LIB) $(BFD_LIB)
245 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOLIBS)
247 core_deps = libmuleappcore.a
248 gui_deps = libmuleappgui.a
249 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
250 common_deps = libmuleappcommon.a $(remote_common_deps)
253 # Flags
255 core_flags = 
256 if ENABLE_UPNP
257 core_flags += -DENABLE_UPNP=1
258 endif
260 gui_flags = $(WX_CXXFLAGS) $(XRCFLAGS)
261 if ENABLE_IP2COUNTRY
262 gui_flags += -DENABLE_IP2COUNTRY=1
263 endif
265 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include
267 # --------- Apps ---------
269 amulegui_SOURCES = \
270         amule-remote-gui.cpp \
271         $(gui_sources) \
272         $(ec_sources) \
273         $(common_sources)
275 amule_SOURCES = \
276         $(core_sources) \
277         $(gui_sources) \
278         $(ec_sources) \
279         $(common_sources)
281 amuled_SOURCES = \
282         amuled.cpp \
283         Timer.cpp \
284         $(core_sources) \
285         $(ec_sources) \
286         $(common_sources)
288 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
289 amule_CFLAGS = $(core_flags) $(gui_flags) $(common_flags)
290 amule_CXXFLAGS = $(core_flags) $(gui_flags) $(common_flags)
291 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
293 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
294 amulegui_CFLAGS = $(gui_flags) $(common_flags) -DCLIENT_GUI -DEC_REMOTE
295 amulegui_CXXFLAGS = $(gui_flags) $(common_flags) -DCLIENT_GUI -DEC_REMOTE
296 amulegui_LDADD =  $(gui_libs) $(common_libs) $(WXBASE_LIBS)
298 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
299 amuled_CFLAGS = $(WXBASE_CFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
300 amuled_CXXFLAGS = $(WXBASE_CXXFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
301 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
303 ed2k_SOURCES = \
304         ED2KLinkParser.cpp \
305         MagnetURI.cpp \
306         MuleCollection.cpp      
308 ed2k_CPPFLAGS = -DUSE_STD_STRING
310 # on Win32
311 if SYS_WIN32
312 ed2k_LDADD = -lshlwapi
313 endif
314 # on Mac
315 if NEED_CORESERVICES
316 ed2k_LDFLAGS = -framework CoreServices
317 endif
319 amulecmd_SOURCES = \
320         TextClient.cpp \
321         ExternalConnector.cpp \
322         $(remote_common_sources)
324 amulecmd_DEPENDENCIES = $(remote_common_deps)
325 amulecmd_CFLAGS = $(WXBASE_CFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
326 amulecmd_CXXFLAGS = $(WXBASE_CXXFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
327 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
328 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
329         $(WXBASE_LIBS) $(READLINE_LIBS) $(ZLIB_LIBS) \
330         $(RESOLV_LIB) $(BFD_LIB)
332 noinst_HEADERS = \
333                 AddFriend.h \
334                 AsyncDNS.h \
335                 amule-remote-gui.h \
336                 amuleDlg.h \
337                 amule.h \
338                 amuleIPV4Address.h \
339                 ArchSpecific.h \
340                 BarShader.h \
341                 CatDialog.h \
342                 CFile.h \
343                 ChatSelector.h \
344                 ChatWnd.h \
345                 ClientCredits.h \
346                 ClientCreditsList.h \
347                 ClientDetailDialog.h \
348                 ClientListCtrl.h \
349                 ClientList.h \
350                 ClientTCPSocket.h \
351                 ClientUDPSocket.h \
352                 ColorFrameCtrl.h \
353                 Color.h \
354                 CommentDialog.h \
355                 CommentDialogLst.h \
356                 Constants.h \
357                 CryptoPP_Inc.h \
358                 DataToText.h \
359                 DeadSourceList.h \
360                 DirectoryTreeCtrl.h \
361                 DownloadListCtrl.h \
362                 DownloadQueue.h \
363                 ED2KLink.h \
364                 EditServerListDlg.h \
365                 EMSocket.h \
366                 EncryptedDatagramSocket.h \
367                 EncryptedStreamSocket.h \
368                 ExternalConnector.h \
369                 ExternalConn.h \
370                 FileDetailDialog.h \
371                 FileDetailListCtrl.h \
372                 FileLock.h \
373                 Friend.h \
374                 FriendListCtrl.h \
375                 FriendList.h \
376                 GetTickCount.h \
377                 GuiEvents.h \
378                 HTTPDownload.h \
379                 inetdownload.h \
380                 InternalEvents.h \
381                 IP2Country.h \
382                 IPFilter.h \
383                 KadDlg.h \
384                 KnownFile.h \
385                 KnownFileList.h \
386                 ListenSocket.h \
387                 Logger.h \
388                 MagnetURI.h \
389                 MD4Hash.h \
390                 MemFile.h \
391                 MuleCollection.h \
392                 MuleGifCtrl.h \
393                 MuleListCtrl.h \
394                 MuleNotebook.h \
395                 MuleTextCtrl.h \
396                 MuleThread.h \
397                 MuleTrayIcon.h \
398                 MuleUDPSocket.h \
399                 muuli_wdr.h \
400                 NetworkFunctions.h \
401                 OScopeCtrl.h \
402                 Observable.h \
403                 ObservableQueue.h \
404                 OtherFunctions.h \
405                 OtherStructs.h \
406                 Packet.h \
407                 Parser.hpp \
408                 PartFileConvert.h \
409                 PartFile.h \
410                 PlatformSpecific.h \
411                 Preferences.h \
412                 PrefsUnifiedDlg.h \
413                 Proxy.h \
414                 RangeMap.h \
415                 RC4Encrypt.h \
416                 RLE.h \
417                 RandomFunctions.h \
418                 SafeFile.h \
419                 Scanner.h \
420                 ScopedPtr.h \
421                 SearchDlg.h \
422                 SearchExpr.h \
423                 SearchFile.h \
424                 SearchListCtrl.h \
425                 SearchList.h \
426                 ServerConnect.h \
427                 Server.h \
428                 ServerListCtrl.h \
429                 ServerList.h \
430                 ServerSocket.h \
431                 ServerUDPSocket.h \
432                 ServerWnd.h \
433                 SHA.h \
434                 SHAHashSet.h \
435                 SharedFileList.h \
436                 SharedFilesCtrl.h \
437                 SharedFilesWnd.h \
438                 StateMachine.h \
439                 StatisticsDlg.h \
440                 Statistics.h \
441                 StatTree.h \
442                 Tag.h \
443                 TerminationProcess.h \
444                 TerminationProcessAmuleweb.h \
445                 TextClient.h \
446                 ThreadScheduler.h \
447                 ThreadTasks.h \
448                 ThrottledSocket.h \
449                 Timer.h \
450                 TransferWnd.h \
451                 Types.h \
452                 updownclient.h \
453                 UploadBandwidthThrottler.h \
454                 UploadQueue.h \
455                 UPnP.h \
456                 UPnPCompatibility.h \
457                 UserEvents.h \
458                 extern/wxWidgets/listctrl.h \
459                 extern/upnp/ixml.h \
460                 extern/upnp/upnp.h
462 MAINTAINERCLEANFILES = Makefile.in
464 $(srcdir)/Parser.cpp: Parser.y
465         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
467 if GENERATE_FLEX_HEADER
468 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
469                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
470 else
471 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
472                 $(LEX) -o$@ $(srcdir)/Scanner.l; \
473                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
474 endif
476 # Resources
478 if NEED_RC
480 SUFFIXES = .rc
482 .rc.$(OBJEXT):
483         $(RC) $(RCFLAGS) -I$(top_srcdir) -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -i "$<" -o "$@"
485 nodist_amuled_SOURCES = amuled-version.rc
486 nodist_amulecmd_SOURCES = amulecmd-version.rc
487 nodist_ed2k_SOURCES = ed2k-version.rc
488 amule_LDADD += amulerc.$(OBJEXT)
489 amule_DEPENDENCIES += amulerc.$(OBJEXT)
490 amulegui_LDADD += amuleguirc.$(OBJEXT)
491 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
493 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
494         cat $^ | \
495         ( \
496                 abs_builddir=`pwd` ; \
497                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
498                 cd $(<D) ; \
499                 $(RC) $(RCFLAGS) -I$${abs_top_srcdir} -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -o "$${abs_builddir}/$@" ; \
500         )
502 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
503         cat $^ | \
504         ( \
505                 abs_builddir=`pwd` ; \
506                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
507                 cd $(<D) ; \
508                 $(RC) $(RCFLAGS) -I$${abs_top_srcdir} -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -o "$${abs_builddir}/$@" ; \
509         )
511 amule-version.rc: $(top_builddir)/version.rc
512         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
513              -e 's/VER_INTERNALNAME_STR/"amule"/' \
514              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
516 amuled-version.rc: $(top_builddir)/version.rc
517         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
518              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
519              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
521 amulecmd-version.rc: $(top_builddir)/version.rc
522         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
523              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
524              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
526 amulegui-version.rc: $(top_builddir)/version.rc
527         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
528              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
529              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
531 ed2k-version.rc: $(top_builddir)/version.rc
532         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
533              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
534              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
536 CLEANFILES = *-version.rc
538 endif
541 EXTRA__DIST__SUBDIRS = include kademlia remote-gui.net
542 include $(top_srcdir)/automake/dist-hook.am