Fix a compiler warning
[amule.git] / src / Makefile.am
blob185274abe16efe9ff1072e0e41f6a5124f2b292c
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         DataToText.cpp \
66         ED2KLink.cpp \
67         GapList.cpp \
68         MagnetURI.cpp \
69         MemFile.cpp \
70         Packet.cpp \
71         RLE.cpp \
72         SafeFile.cpp \
73         SHA.cpp \
74         Tag.cpp \
75         Timer.cpp
77 libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
80 # Common to core/monolithic
82 libmuleappcore_a_SOURCES = \
83         AsyncDNS.cpp \
84         DeadSourceList.cpp \
85         FileArea.cpp \
86         FileAutoClose.cpp \
87         Friend.cpp \
88         Scanner.cpp \
89         Parser.cpp \
90         PlatformSpecific.cpp \
91         RandomFunctions.cpp \
92         RC4Encrypt.cpp \
93         StateMachine.cpp \
94         ThreadScheduler.cpp \
95         UPnPBase.cpp \
96         kademlia/kademlia/Entry.cpp \
97         kademlia/kademlia/SearchManager.cpp \
98         kademlia/routing/Contact.cpp \
99         kademlia/routing/RoutingBin.cpp \
100         kademlia/utils/UInt128.cpp
102 libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS)
105 # Common to gui/monolithic
107 libmuleappgui_a_SOURCES = \
108         BarShader.cpp \
109         ChatWnd.cpp \
110         ColorFrameCtrl.cpp \
111         CommentDialog.cpp \
112         CommentDialogLst.cpp \
113         EditServerListDlg.cpp \
114         extern/wxWidgets/listctrl.cpp \
115         FileDetailListCtrl.cpp \
116         IP2Country.cpp \
117         MuleGifCtrl.cpp \
118         MuleListCtrl.cpp \
119         MuleNotebook.cpp \
120         MuleTextCtrl.cpp \
121         MuleCollection.cpp \
122         muuli_wdr.cpp 
124 libmuleappgui_a_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(LIBUPNP_CPPFLAGS) $(GEOIP_CPPFLAGS)
126 core_sources = \
127         amule.cpp \
128         BaseClient.cpp \
129         CanceledFileList.cpp \
130         ClientList.cpp \
131         ClientCreditsList.cpp \
132         ClientTCPSocket.cpp \
133         ClientUDPSocket.cpp \
134         CorruptionBlackBox.cpp \
135         DownloadClient.cpp \
136         DownloadQueue.cpp \
137         ECSpecialCoreTags.cpp \
138         EMSocket.cpp \
139         EncryptedStreamSocket.cpp \
140         EncryptedDatagramSocket.cpp \
141         ExternalConn.cpp \
142         FriendList.cpp \
143         HTTPDownload.cpp \
144         IPFilter.cpp \
145         IPFilterScanner.cpp \
146         KnownFileList.cpp \
147         ListenSocket.cpp \
148         MuleUDPSocket.cpp \
149         PartFileConvert.cpp \
150         SearchFile.cpp \
151         SearchList.cpp \
152         ServerConnect.cpp \
153         ServerList.cpp \
154         ServerSocket.cpp \
155         ServerUDPSocket.cpp \
156         SharedFileList.cpp \
157         TerminationProcessAmuleweb.cpp \
158         ThreadTasks.cpp \
159         UploadBandwidthThrottler.cpp \
160         UploadClient.cpp \
161         UploadQueue.cpp \
162         kademlia/kademlia/Indexed.cpp \
163         kademlia/kademlia/Kademlia.cpp \
164         kademlia/kademlia/Prefs.cpp \
165         kademlia/kademlia/Search.cpp \
166         kademlia/kademlia/UDPFirewallTester.cpp \
167         kademlia/net/KademliaUDPListener.cpp \
168         kademlia/net/PacketTracking.cpp \
169         kademlia/routing/RoutingZone.cpp
172 gui_sources = \
173         amule-gui.cpp \
174         amuleDlg.cpp \
175         AddFriend.cpp \
176         CatDialog.cpp \
177         ChatSelector.cpp \
178         GenericClientListCtrl.cpp \
179         ClientDetailDialog.cpp \
180         DirectoryTreeCtrl.cpp \
181         FileDetailDialog.cpp \
182         KadDlg.cpp \
183         OScopeCtrl.cpp \
184         PartFileConvertDlg.cpp \
185         PrefsUnifiedDlg.cpp \
186         SearchDlg.cpp \
187         ServerWnd.cpp \
188         SharedFilesWnd.cpp \
189         StatisticsDlg.cpp \
190         SearchListCtrl.cpp \
191         DownloadListCtrl.cpp \
192         SourceListCtrl.cpp \
193         SharedFilePeersListCtrl.cpp \
194         FriendListCtrl.cpp \
195         ServerListCtrl.cpp \
196         SharedFilesCtrl.cpp \
197         MuleTrayIcon.cpp \
198         MuleColour.cpp \
199         TransferWnd.cpp 
202 remote_common_sources = \
203         OtherFunctions.cpp \
204         NetworkFunctions.cpp 
206 common_sources = \
207         amuleAppCommon.cpp \
208         ClientCredits.cpp \
209         ECSpecialMuleTags.cpp \
210         KnownFile.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         UserEvents.cpp \
223         $(remote_common_sources)
225 # Libs
227 core_libs = -L. -lmuleappcore $(LIBUPNP_LDFLAGS) $(LIBUPNP_LIBS)
228 gui_libs = -L. -lmuleappgui $(WX_LIBS) $(GEOIP_LDFLAGS) $(GEOIP_LIBS)
229 remote_common_libs = -Llibs/common -Llibs/ec/cpp -lmulecommon -lec $(BFD_LIBS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS) $(RESOLV_LIB)
230 common_libs = -L. -lmuleappcommon $(remote_common_libs) $(CRYPTOPP_LDFLAGS) $(CRYPTOPP_LIBS)
232 core_deps = libmuleappcore.a
233 gui_deps = libmuleappgui.a
234 remote_common_deps = libs/common/libmulecommon.a libs/ec/cpp/libec.a
235 common_deps = libmuleappcommon.a $(remote_common_deps)
237 if SYS_WIN32
238 core_libs += -lshlwapi
239 endif
242 # Flags
244 core_flags = $(LIBUPNP_CPPFLAGS) $(LIBUPNP_CFLAGS)
245 gui_flags = $(WX_CPPFLAGS) $(GEOIP_CPPFLAGS)
246 common_flags = -I$(srcdir)/libs -Ilibs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS)
248 # --------- Apps ---------
250 amulegui_SOURCES = \
251         amule-remote-gui.cpp \
252         HTTPDownload.cpp \
253         $(gui_sources) \
254         $(ec_sources) \
255         $(common_sources)
257 amule_SOURCES = \
258         CaptchaDialog.cpp \
259         CaptchaGenerator.cpp \
260         $(core_sources) \
261         $(gui_sources) \
262         $(ec_sources) \
263         $(common_sources)
265 amuled_SOURCES = \
266         amuled.cpp \
267         Timer.cpp \
268         $(core_sources) \
269         $(ec_sources) \
270         $(common_sources)
272 amule_DEPENDENCIES = $(common_deps) $(core_deps) $(gui_deps)
273 amule_CPPFLAGS = $(AM_CPPFLAGS) $(core_flags) $(gui_flags) $(common_flags)
274 amule_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CPPFLAGS_ONLY)
275 amule_LDADD = $(common_libs) $(core_libs) $(gui_libs)
277 amulegui_DEPENDENCIES = $(common_deps) $(gui_deps)
278 amulegui_CPPFLAGS = $(AM_CPPFLAGS) $(gui_flags) $(common_flags) -DCLIENT_GUI
279 amulegui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
280 amulegui_LDADD = $(gui_libs) $(common_libs) $(WXBASE_LIBS)
282 amuled_DEPENDENCIES = $(core_deps) $(common_deps)
283 amuled_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(core_flags) $(common_flags) -DAMULE_DAEMON 
284 amuled_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CFLAGS_ONLY) $(WX_CXXFLAGS_ONLY)
285 amuled_LDADD = $(common_libs) $(core_libs) $(WXBASE_LIBS)
287 ed2k_SOURCES = \
288         ED2KLinkParser.cpp \
289         MagnetURI.cpp \
290         MuleCollection.cpp      
292 ed2k_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_STD_STRING
294 # on Win32
295 if SYS_WIN32
296 ed2k_LDADD = -lshlwapi
297 endif
298 # on Mac
299 if NEED_CORESERVICES
300 ed2k_LDFLAGS = $(AM_LDFLAGS) -framework CoreServices
301 endif
303 amulecmd_SOURCES = \
304         TextClient.cpp \
305         ExternalConnector.cpp \
306         LoggerConsole.cpp \
307         $(remote_common_sources)
309 amulecmd_DEPENDENCIES = $(remote_common_deps)
310 amulecmd_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) $(common_flags)
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                 BitVector.h \
326                 CanceledFileList.h \
327                 CaptchaDialog.h \
328                 CaptchaGenerator.h \
329                 CatDialog.h \
330                 CFile.h \
331                 ChatSelector.h \
332                 ChatWnd.h \
333                 ClientCredits.h \
334                 ClientCreditsList.h \
335                 ClientDetailDialog.h \
336                 SharedFilePeersListCtrl.h \
337                 ClientList.h \
338                 ClientTCPSocket.h \
339                 ClientUDPSocket.h \
340                 ColorFrameCtrl.h \
341                 CommentDialog.h \
342                 CommentDialogLst.h \
343                 Constants.h \
344                 CorruptionBlackBox.h \
345                 CryptoPP_Inc.h \
346                 DataToText.h \
347                 DeadSourceList.h \
348                 DirectoryTreeCtrl.h \
349                 DownloadListCtrl.h \
350                 DownloadQueue.h \
351                 ED2KLink.h \
352                 EditServerListDlg.h \
353                 EMSocket.h \
354                 EncryptedDatagramSocket.h \
355                 EncryptedStreamSocket.h \
356                 ExternalConnector.h \
357                 ExternalConn.h \
358                 FileArea.h \
359                 FileAutoClose.h \
360                 FileDetailDialog.h \
361                 FileDetailListCtrl.h \
362                 FileLock.h \
363                 Friend.h \
364                 FriendListCtrl.h \
365                 FriendList.h \
366                 GapList.h \
367                 GetTickCount.h \
368                 GenericClientListCtrl.h \
369                 GuiEvents.h \
370                 HTTPDownload.h \
371                 inetdownload.h \
372                 InternalEvents.h \
373                 IP2Country.h \
374                 IPFilter.h \
375                 IPFilterScanner.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                 PartFileConvertDlg.h \
404                 PartFile.h \
405                 PlatformSpecific.h \
406                 Preferences.h \
407                 PrefsUnifiedDlg.h \
408                 Proxy.h \
409                 RangeMap.h \
410                 RC4Encrypt.h \
411                 RLE.h \
412                 RandomFunctions.h \
413                 SafeFile.h \
414                 Scanner.h \
415                 ScopedPtr.h \
416                 SearchDlg.h \
417                 SearchExpr.h \
418                 SearchFile.h \
419                 SearchListCtrl.h \
420                 SearchList.h \
421                 ServerConnect.h \
422                 Server.h \
423                 ServerListCtrl.h \
424                 ServerList.h \
425                 ServerSocket.h \
426                 ServerUDPSocket.h \
427                 ServerWnd.h \
428                 SHA.h \
429                 SHAHashSet.h \
430                 SharedFileList.h \
431                 SharedFilesCtrl.h \
432                 SharedFilesWnd.h \
433                 SourceListCtrl.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                 UPnPBase.h \
452                 UPnPCompatibility.h \
453                 UserEvents.h \
454                 extern/wxWidgets/listctrl.h
456 MAINTAINERCLEANFILES = Makefile.in
458 $(srcdir)/Parser.cpp: Parser.y
459         bison --debug -t -d -v -o $@ $(srcdir)/Parser.y
461 if GENERATE_FLEX_HEADER
462 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
463                 $(LEX) --header-file=$(srcdir)/Scanner.h -o $@ $(srcdir)/Scanner.l
464 else
465 $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
466                 $(LEX) -o $@ $(srcdir)/Scanner.l; \
467                 echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
468 endif
470 $(srcdir)/IPFilterScanner.cpp: IPFilterScanner.l
471                 $(LEX) -Pyyip -o $@ $(srcdir)/IPFilterScanner.l;
473 # Resources
475 if NEED_RC
477 SUFFIXES = .rc
479 .rc.$(OBJEXT):
480         $(RC) $(MULERCFLAGS) -I$(top_srcdir) $(RCFLAGS) -O COFF -i "$<" -o "$@"
482 nodist_amuled_SOURCES = amuled-version.rc
483 nodist_amulecmd_SOURCES = amulecmd-version.rc
484 nodist_ed2k_SOURCES = ed2k-version.rc
485 amule_LDADD += amulerc.$(OBJEXT)
486 amule_DEPENDENCIES += amulerc.$(OBJEXT)
487 amulegui_LDADD += amuleguirc.$(OBJEXT)
488 amulegui_DEPENDENCIES += amuleguirc.$(OBJEXT)
490 amulerc.$(OBJEXT): $(srcdir)/../amule.rc amule-version.rc
491         cat $^ | \
492         ( \
493                 abs_builddir=`pwd` ; \
494                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
495                 cd $(<D) ; \
496                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
497         )
499 amuleguirc.$(OBJEXT): $(srcdir)/../amule.rc amulegui-version.rc
500         cat $^ | \
501         ( \
502                 abs_builddir=`pwd` ; \
503                 abs_top_srcdir=`cd $(top_srcdir) ; pwd` ; \
504                 cd $(<D) ; \
505                 $(RC) $(MULERCFLAGS) -I$${abs_top_srcdir} $(RCFLAGS) -O COFF -o "$${abs_builddir}/$@" ; \
506         )
508 amule-version.rc: $(top_builddir)/version.rc
509         @sed -e 's/VER_FILEDESCRIPTION_STR/"All-Platform P2P Client Based on eMule"/' \
510              -e 's/VER_INTERNALNAME_STR/"amule"/' \
511              -e 's/VER_ORIGINALFILENAME_STR/"amule$(EXEEXT)"/' "$<" > "$@"
513 amuled-version.rc: $(top_builddir)/version.rc
514         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Daemon"/' \
515              -e 's/VER_INTERNALNAME_STR/"amuled"/' \
516              -e 's/VER_ORIGINALFILENAME_STR/"amuled$(EXEEXT)"/' "$<" > "$@"
518 amulecmd-version.rc: $(top_builddir)/version.rc
519         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Text Client"/' \
520              -e 's/VER_INTERNALNAME_STR/"amulecmd"/' \
521              -e 's/VER_ORIGINALFILENAME_STR/"amulecmd$(EXEEXT)"/' "$<" > "$@"
523 amulegui-version.rc: $(top_builddir)/version.rc
524         @sed -e 's/VER_FILEDESCRIPTION_STR/"aMule Remote GUI (Experimental)"/' \
525              -e 's/VER_INTERNALNAME_STR/"amulegui"/' \
526              -e 's/VER_ORIGINALFILENAME_STR/"amulegui$(EXEEXT)"/' "$<" > "$@"
528 ed2k-version.rc: $(top_builddir)/version.rc
529         @sed -e 's/VER_FILEDESCRIPTION_STR/"ED2K Links Handler"/' \
530              -e 's/VER_INTERNALNAME_STR/"ed2k"/' \
531              -e 's/VER_ORIGINALFILENAME_STR/"ed2k$(EXEEXT)"/' "$<" > "$@"
533 CLEANFILES = *-version.rc
535 endif
538 EXTRA__DIST__SUBDIRS = include kademlia
539 include $(top_srcdir)/automake/dist-hook.am