Upstream tarball 20080304
[amule.git] / src / Makefile.am
blobae275124adada50f9b827abf56d11f1d7c68bac3
1 if WEB
2 OPT_WEB = webserver
3 endif
5 SUBDIRS = libs utils pixmaps kademlia 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         kademlia/utils/LittleEndian.cpp \
97         kademlia/kademlia/SearchManager.cpp \
98         kademlia/routing/RoutingBin.cpp \
99         StateMachine.cpp \
100         ThreadScheduler.cpp
102 libmuleappcore_a_CFLAGS = $(WXBASE_CFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
103 libmuleappcore_a_CXXFLAGS = $(WXBASE_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
104 if ENABLE_UPNP
105 libmuleappcore_a_CFLAGS += -DENABLE_UPNP=1
106 libmuleappcore_a_CXXFLAGS += -DENABLE_UPNP=1
107 endif
110 # Common to gui/monolithic
112 libmuleappgui_a_SOURCES = \
113         BarShader.cpp \
114         ChatWnd.cpp \
115         ColorFrameCtrl.cpp \
116         CommentDialog.cpp \
117         CommentDialogLst.cpp \
118         DirectoryTreeCtrl.cpp \
119         EditServerListDlg.cpp \
120         extern/wxWidgets/listctrl.cpp \
121         FileDetailListCtrl.cpp \
122         MuleGifCtrl.cpp \
123         MuleListCtrl.cpp \
124         MuleNotebook.cpp \
125         MuleTextCtrl.cpp \
126         MuleCollection.cpp \
127         muuli_wdr.cpp 
129 libmuleappgui_a_CFLAGS = $(WX_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
130 libmuleappgui_a_CXXFLAGS = $(WX_CXXFLAGS) -I$(srcdir)/libs -I$(srcdir)/include
131 if ENABLE_UPNP
132 libmuleappgui_a_CFLAGS += -DENABLE_UPNP=1
133 libmuleappgui_a_CXXFLAGS += -DENABLE_UPNP=1
134 endif
136 core_sources = \
137         RC4Encrypt.cpp \
138         amule.cpp \
139         BaseClient.cpp \
140         ClientList.cpp \
141         ClientCreditsList.cpp \
142         ClientTCPSocket.cpp \
143         ClientUDPSocket.cpp \
144         DownloadClient.cpp \
145         DownloadQueue.cpp \
146         ECSpecialCoreTags.cpp \
147         EMSocket.cpp \
148         EncryptedStreamSocket.cpp \
149         EncryptedDatagramSocket.cpp \
150         ExternalConn.cpp \
151         Friend.cpp \
152         FriendList.cpp \
153         HTTPDownload.cpp \
154         IPFilter.cpp \
155         KnownFileList.cpp \
156         ListenSocket.cpp \
157         MuleUDPSocket.cpp \
158         SearchFile.cpp \
159         SearchList.cpp \
160         ServerConnect.cpp \
161         ServerList.cpp \
162         ServerSocket.cpp \
163         ServerUDPSocket.cpp \
164         SharedFileList.cpp \
165         ThreadTasks.cpp \
166         UploadBandwidthThrottler.cpp \
167         UploadClient.cpp \
168         UploadQueue.cpp \
169         kademlia/kademlia/Kademlia.cpp \
170         kademlia/kademlia/Search.cpp \
171         kademlia/kademlia/Indexed.cpp \
172         kademlia/net/KademliaUDPListener.cpp \
173         kademlia/kademlia/Prefs.cpp \
174         kademlia/routing/RoutingZone.cpp \
175         kademlia/routing/Contact.cpp 
177 if ENABLE_UPNP
178 core_sources += \
179         UPnP.cpp \
180         UPnPCompatibility.cpp
181 endif
183 gui_sources = \
184         amule-gui.cpp \
185         amuleDlg.cpp \
186         AddFriend.cpp \
187         CatDialog.cpp \
188         ChatSelector.cpp \
189         ClientDetailDialog.cpp \
190         FileDetailDialog.cpp \
191         KadDlg.cpp \
192         OScopeCtrl.cpp \
193         PartFileConvert.cpp \
194         PrefsUnifiedDlg.cpp \
195         SearchDlg.cpp \
196         ServerWnd.cpp \
197         SharedFilesWnd.cpp \
198         StatisticsDlg.cpp \
199         SearchListCtrl.cpp \
200         DownloadListCtrl.cpp \
201         ClientListCtrl.cpp \
202         FriendListCtrl.cpp \
203         ServerListCtrl.cpp \
204         SharedFilesCtrl.cpp \
205         MuleTrayIcon.cpp \
206         TransferWnd.cpp 
208 if ENABLE_IP2COUNTRY
209 gui_sources += \
210         IP2Country.cpp
211 endif
214 remote_common_sources = \
215         OtherFunctions.cpp \
216         NetworkFunctions.cpp 
218 common_sources = \
219         ClientCredits.cpp \
220         ECSpecialMuleTags.cpp \
221         KnownFile.cpp \
222         GetTickCount.cpp \
223         GuiEvents.cpp \
224         Logger.cpp \
225         PartFile.cpp \
226         Preferences.cpp \
227         Proxy.cpp \
228         Server.cpp \
229         Statistics.cpp \
230         StatTree.cpp \
231         SHAHashSet.cpp \
232         TerminationProcess.cpp \
233         TerminationProcessAmuleweb.cpp \
234         UserEvents.cpp \
235         $(remote_common_sources)
237 # Libs
239 core_libs = -L. -lmuleappcore
240 gui_libs = -L. -lmuleappgui $(X11LIBS) $(WX_LIBS)
241 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(ZLIB_LIBS) $(RESOLV_LIB) $(BFD_LIB)
242 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOLIBS)
244 core_deps = libmuleappcore.a
245 gui_deps = libmuleappgui.a
246 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
247 common_deps = libmuleappcommon.a $(remote_common_deps)
250 # Flags
252 core_flags = 
253 if ENABLE_UPNP
254 core_flags += -DENABLE_UPNP=1
255 endif
257 gui_flags = $(WX_CXXFLAGS) $(XRCFLAGS)
258 if ENABLE_IP2COUNTRY
259 gui_flags += -DENABLE_IP2COUNTRY=1
260 endif
262 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include
264 # --------- Apps ---------
266 amulegui_SOURCES = \
267         amule-remote-gui.cpp \
268         $(gui_sources) \
269         $(ec_sources) \
270         $(common_sources)
272 amule_SOURCES = \
273         $(core_sources) \
274         $(gui_sources) \
275         $(ec_sources) \
276         $(common_sources)
278 amuled_SOURCES = \
279         amuled.cpp \
280         Timer.cpp \
281         $(core_sources) \
282         $(ec_sources) \
283         $(common_sources)
285 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
286 amule_CFLAGS = $(core_flags) $(gui_flags) $(common_flags)
287 amule_CXXFLAGS = $(core_flags) $(gui_flags) $(common_flags)
288 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
290 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
291 amulegui_CFLAGS = $(gui_flags) $(common_flags) -DCLIENT_GUI -DEC_REMOTE
292 amulegui_CXXFLAGS = $(gui_flags) $(common_flags) -DCLIENT_GUI -DEC_REMOTE
293 amulegui_LDADD =  $(gui_libs) $(common_libs) $(WXBASE_LIBS)
295 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
296 amuled_CFLAGS = $(WXBASE_CFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
297 amuled_CXXFLAGS = $(WXBASE_CXXFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
298 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
300 ed2k_SOURCES = \
301         ED2KLinkParser.cpp \
302         MagnetURI.cpp \
303         MuleCollection.cpp      
305 ed2k_CPPFLAGS = -DUSE_STD_STRING
307 # on Win32
308 if SYS_WIN32
309 ed2k_LDADD = -lshlwapi
310 endif
311 # on Mac
312 if NEED_CORESERVICES
313 ed2k_LDFLAGS = -framework CoreServices
314 endif
316 amulecmd_SOURCES = \
317         TextClient.cpp \
318         ExternalConnector.cpp \
319         $(remote_common_sources)
321 amulecmd_DEPENDENCIES = $(remote_common_deps)
322 amulecmd_CFLAGS = $(WXBASE_CFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
323 amulecmd_CXXFLAGS = $(WXBASE_CXXFLAGS) $(common_flags) -DEC_REMOTE -DECSOCKET_USE_EVENTS=0
324 #amulecmd_LDADD = $(WXBASE_LIBS) $(READLINE_LIBS) $(remote_common_libs)
325 amulecmd_LDADD = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec \
326         $(WXBASE_LIBS) $(READLINE_LIBS) $(ZLIB_LIBS) \
327         $(RESOLV_LIB) $(BFD_LIB)
329 noinst_HEADERS = \
330                 AddFriend.h \
331                 AsyncDNS.h \
332                 amule-remote-gui.h \
333                 amuleDlg.h \
334                 amule.h \
335                 amuleIPV4Address.h \
336                 ArchSpecific.h \
337                 BarShader.h \
338                 CatDialog.h \
339                 CFile.h \
340                 ChatSelector.h \
341                 ChatWnd.h \
342                 ClientCredits.h \
343                 ClientCreditsList.h \
344                 ClientDetailDialog.h \
345                 ClientListCtrl.h \
346                 ClientList.h \
347                 ClientTCPSocket.h \
348                 ClientUDPSocket.h \
349                 ColorFrameCtrl.h \
350                 Color.h \
351                 CommentDialog.h \
352                 CommentDialogLst.h \
353                 Constants.h \
354                 CryptoPP_Inc.h \
355                 DataToText.h \
356                 DeadSourceList.h \
357                 DirectoryTreeCtrl.h \
358                 DownloadListCtrl.h \
359                 DownloadQueue.h \
360                 ED2KLink.h \
361                 EditServerListDlg.h \
362                 EMSocket.h \
363                 EncryptedDatagramSocket.h \
364                 EncryptedStreamSocket.h \
365                 ExternalConnector.h \
366                 ExternalConn.h \
367                 FileDetailDialog.h \
368                 FileDetailListCtrl.h \
369                 FileLock.h \
370                 Friend.h \
371                 FriendListCtrl.h \
372                 FriendList.h \
373                 GetTickCount.h \
374                 GuiEvents.h \
375                 HTTPDownload.h \
376                 inetdownload.h \
377                 InternalEvents.h \
378                 IP2Country.h \
379                 IPFilter.h \
380                 KadDlg.h \
381                 KnownFile.h \
382                 KnownFileList.h \
383                 ListenSocket.h \
384                 Logger.h \
385                 MagnetURI.h \
386                 MD4Hash.h \
387                 MemFile.h \
388                 MuleCollection.h \
389                 MuleGifCtrl.h \
390                 MuleListCtrl.h \
391                 MuleNotebook.h \
392                 MuleTextCtrl.h \
393                 MuleThread.h \
394                 MuleTrayIcon.h \
395                 MuleUDPSocket.h \
396                 muuli_wdr.h \
397                 NetworkFunctions.h \
398                 OScopeCtrl.h \
399                 Observable.h \
400                 ObservableQueue.h \
401                 OtherFunctions.h \
402                 OtherStructs.h \
403                 Packet.h \
404                 Parser.hpp \
405                 PartFileConvert.h \
406                 PartFile.h \
407                 Preferences.h \
408                 PrefsUnifiedDlg.h \
409                 Proxy.h \
410                 RangeMap.h \
411                 RC4Encrypt.h \
412                 RLE.h \
413                 RandomFunctions.h \
414                 SafeFile.h \
415                 Scanner.h \
416                 ScopedPtr.h \
417                 SearchDlg.h \
418                 SearchExpr.h \
419                 SearchFile.h \
420                 SearchListCtrl.h \
421                 SearchList.h \
422                 ServerConnect.h \
423                 Server.h \
424                 ServerListCtrl.h \
425                 ServerList.h \
426                 ServerSocket.h \
427                 ServerUDPSocket.h \
428                 ServerWnd.h \
429                 SHA.h \
430                 SHAHashSet.h \
431                 SharedFileList.h \
432                 SharedFilesCtrl.h \
433                 SharedFilesWnd.h \
434                 StateMachine.h \
435                 StatisticsDlg.h \
436                 Statistics.h \
437                 StatTree.h \
438                 Tag.h \
439                 TerminationProcess.h \
440                 TerminationProcessAmuleweb.h \
441                 TextClient.h \
442                 ThreadScheduler.h \
443                 ThreadTasks.h \
444                 ThrottledSocket.h \
445                 Timer.h \
446                 TransferWnd.h \
447                 Types.h \
448                 updownclient.h \
449                 UploadBandwidthThrottler.h \
450                 UploadQueue.h \
451                 UPnP.h \
452                 UPnPCompatibility.h \
453                 UserEvents.h \
454                 extern/wxWidgets/listctrl.h \
455                 extern/upnp/ixml.h \
456                 extern/upnp/upnp.h
458 MAINTAINERCLEANFILES = Makefile.in
460 $(srcdir)/Parser.cpp: Parser.y
461         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
463 if GENERATE_FLEX_HEADER
464 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
465                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
466 else
467 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
468                 $(LEX) -o$@ $(srcdir)/Scanner.l; \
469                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
470 endif
472 # Resources
474 if NEED_RC
476 SUFFIXES = .rc
478 .rc.$(OBJEXT):
479         $(RC) $(RCFLAGS) -I$(top_srcdir) -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -i "$<" -o "$@"
481 nodist_amuled_SOURCES = amuled-version.rc
482 nodist_amulecmd_SOURCES = amulecmd-version.rc
483 nodist_ed2k_SOURCES = ed2k-version.rc
484 amule_LDADD += amulerc.$(OBJEXT)
485 amule_DEPENDENCIES += amulerc.$(OBJEXT)
486 amulegui_LDADD += amuleguirc.$(OBJEXT)
487 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
489 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
490         cat $^ | \
491         ( \
492                 abs_builddir=`pwd` ; \
493                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
494                 cd $(<D) ; \
495                 $(RC) $(RCFLAGS) -I$${abs_top_srcdir} -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -o "$${abs_builddir}/$@" ; \
496         )
498 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
499         cat $^ | \
500         ( \
501                 abs_builddir=`pwd` ; \
502                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
503                 cd $(<D) ; \
504                 $(RC) $(RCFLAGS) -I$${abs_top_srcdir} -D__WIN95__ -D__WIN32__ -D__GNUWIN32__ -O COFF -o "$${abs_builddir}/$@" ; \
505         )
507 amule-version.rc: $(top_builddir)/version.rc
508         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
509              -e 's/VER_INTERNALNAME_STR/"amule"/' \
510              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
512 amuled-version.rc: $(top_builddir)/version.rc
513         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
514              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
515              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
517 amulecmd-version.rc: $(top_builddir)/version.rc
518         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
519              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
520              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
522 amulegui-version.rc: $(top_builddir)/version.rc
523         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
524              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
525              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
527 ed2k-version.rc: $(top_builddir)/version.rc
528         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
529              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
530              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
532 CLEANFILES = *-version.rc
534 endif
537 EXTRA__DIST__SUBDIRS = include remote-gui.net
538 include $(top_srcdir)/automake/dist-hook.am