cfb89a58da59d355290872a2a2b3b1b61dc2cfb8
[claws.git] / src / Makefile.am
1 # Copyright 1999-2014 the Claws Mail team.
2 # This file is part of Claws Mail package, and distributed under the
3 # terms of the General Public License version 3 (or later).
4 # See COPYING file for license details.
5
6 if CLAWS_LIBETPAN
7 etpan_dir = etpan
8 etpan_library = etpan/libclawsetpan.la
9 else
10 etpan_dir =
11 etpan_library = 
12 endif
13
14 SUBDIRS = common gtk $(etpan_dir) . plugins 
15
16 bin_PROGRAMS = claws-mail
17 install-exec-hook:
18         @rm -f $(DESTDIR)$(bindir)/sylpheed-claws
19         @ln -s claws-mail $(DESTDIR)$(bindir)/sylpheed-claws
20
21 if PLATFORM_WIN32
22 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
23      `echo $(DEFS) $(DEFAULT_INCLUDES) $(IFLAGS) | \
24      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
25
26 %.o : %.rc
27         $(LTRCCOMPILE) -i $< -o $@
28
29 claws_mail_res_ldflag = -Wl,w32-resource.o
30 claws_mail_deps = w32-resource.o
31 else
32 claws_mail_res_ldflag =
33 claws_mail_deps =
34 endif
35
36 new_abook_source = \
37         addressbook-dbus.c
38 old_abook_source = \
39         addrbook.c \
40         addrclip.c \
41         addrcustomattr.c \
42         addressbook.c \
43         addressbook_foldersel.c \
44         addrindex.c \
45         addrquery.c \
46         addrselect.c \
47         addrduplicates.c \
48         browseldap.c \
49         editaddress.c \
50         editaddress_other_attributes_ldap.c \
51         editbook.c \
52         editgroup.c \
53         editjpilot.c \
54         editldap_basedn.c \
55         editldap.c \
56         editvcard.c \
57         exphtmldlg.c \
58         expldifdlg.c \
59         exporthtml.c \
60         exportldif.c \
61         importldif.c \
62         importmutt.c \
63         importpine.c \
64         jpilot.c \
65         ldapctrl.c \
66         ldaplocate.c \
67         ldapquery.c \
68         ldapserver.c \
69         ldapupdate.c \
70         ldaputil.c \
71         ldif.c \
72         mutt.c \
73         pine.c \
74         vcard.c
75
76 if BUILD_NEWADDRBOOK
77 abook_source = $(new_abook_source)
78 abook_extra = $(old_abook_source)
79 else
80 abook_source = $(old_abook_source)
81 abook_extra = $(new_abook_source)
82 endif
83
84 abook_headers = \
85         addressbook-dbus.h \
86         adbookbase.h \
87         addrbook.h \
88         addrclip.h \
89         addrcustomattr.h \
90         addressbook.h \
91         addressbook_foldersel.h \
92         addrindex.h \
93         addrquery.h \
94         addrselect.h \
95         addrduplicates.h \
96         browseldap.h \
97         editaddress.h \
98         editaddress_other_attributes_ldap.h \
99         editbook.h \
100         editgroup.h \
101         editjpilot.h \
102         editldap_basedn.h \
103         editldap.h \
104         editvcard.h \
105         exphtmldlg.h \
106         expldifdlg.h \
107         exporthtml.h \
108         exportldif.h \
109         file_checker.h \
110         importldif.h \
111         importmutt.h \
112         importpine.h \
113         jpilot.h \
114         ldapctrl.h \
115         ldaplocate.h \
116         ldapquery.h \
117         ldapserver.h \
118         ldapupdate.h \
119         ldaputil.h \
120         ldif.h \
121         mutt.h \
122         pine.h \
123         vcard.h
124
125 claws_mail_SOURCES = \
126         account.c \
127         action.c \
128         addrcache.c \
129         addr_compl.c \
130         addressadd.c \
131         addrgather.c \
132         addrharvest.c \
133         addritem.c \
134         advsearch.c \
135         alertpanel.c \
136         autofaces.c \
137         avatars.c \
138         codeconv.c \
139         compose.c \
140         crash.c \
141         customheader.c \
142         displayheader.c \
143         edittags.c \
144         enriched.c \
145         export.c \
146         file_checker.c \
147         filtering.c \
148         folder.c \
149         folder_item_prefs.c \
150         foldersel.c \
151         folderutils.c \
152         folderview.c \
153         grouplistdialog.c \
154         headerview.c \
155         html.c \
156         image_viewer.c \
157         imap.c \
158         imap_gtk.c \
159         import.c \
160         inc.c \
161         localfolder.c \
162         main.c \
163         mainwindow.c \
164         manual.c \
165         matcher.c \
166         matcher_parser_lex.l \
167         matcher_parser_parse.y \
168         mbox.c \
169         message_search.c \
170         messageview.c \
171         mh.c \
172         mh_gtk.c \
173         mimeview.c \
174         msgcache.c \
175         news.c \
176         news_gtk.c \
177         noticeview.c \
178         partial_download.c \
179         pop.c \
180         prefs_account.c \
181         prefs_actions.c \
182         prefs_common.c \
183         prefs_compose_writing.c \
184         prefs_customheader.c \
185         prefs_display_header.c \
186         prefs_ext_prog.c \
187         prefs_filtering_action.c \
188         prefs_filtering.c \
189         prefs_folder_item.c \
190         prefs_fonts.c \
191         prefs_gtk.c \
192         prefs_image_viewer.c \
193         prefs_logging.c \
194         prefs_matcher.c \
195         prefs_message.c \
196         prefs_msg_colors.c \
197         prefs_other.c \
198         prefs_quote.c \
199         prefs_receive.c \
200         prefs_send.c \
201         prefs_spelling.c \
202         prefs_summaries.c \
203         prefs_summary_column.c \
204         prefs_summary_open.c \
205         prefs_folder_column.c \
206         prefs_template.c \
207         prefs_themes.c \
208         prefs_toolbar.c \
209         prefs_wrapping.c \
210         printing.c \
211         privacy.c \
212         procheader.c \
213         procmime.c \
214         procmsg.c \
215         quote_fmt.c \
216         quote_fmt_lex.l \
217         quote_fmt_parse.y \
218         recv.c \
219         remotefolder.c \
220         send_message.c \
221         setup.c \
222         simple-gettext.c \
223         sourcewindow.c \
224         ssl_manager.c \
225         statusbar.c \
226         stock_pixmap.c \
227         summary_search.c \
228         summaryview.c \
229         textview.c \
230         toolbar.c \
231         undo.c \
232         unmime.c \
233         uri_opener.c \
234         wizard.c \
235         $(abook_source)
236
237 claws_mailincludedir = $(pkgincludedir)
238 claws_mailinclude_HEADERS = \
239         account.h \
240         action.h \
241         addrcache.h \
242         addr_compl.h \
243         addrdefs.h \
244         addressadd.h \
245         addritem.h \
246         addressitem.h \
247         addrgather.h \
248         addrharvest.h \
249         advsearch.h \
250         alertpanel.h \
251         autofaces.h \
252         avatars.h \
253         codeconv.h \
254         compose.h \
255         crash.h \
256         customheader.h \
257         displayheader.h \
258         edittags.h \
259         enriched.h \
260         export.h \
261         filtering.h \
262         folder.h \
263         folder_item_prefs.h \
264         foldersel.h \
265         folderutils.h \
266         folderview.h \
267         grouplistdialog.h \
268         headerview.h \
269         html.h \
270         image_viewer.h \
271         imap.h \
272         imap_gtk.h \
273         import.h \
274         inc.h \
275         localfolder.h \
276         main.h \
277         mainwindow.h \
278         manual.h \
279         matcher.h \
280         matchertypes.h \
281         matcher_parser.h \
282         matcher_parser_lex.h \
283         matcher_parser_parse.h \
284         mbox.h \
285         message_search.h \
286         messageview.h \
287         mh.h \
288         mh_gtk.h \
289         mimeview.h \
290         msgcache.h \
291         news.h \
292         news_gtk.h \
293         noticeview.h \
294         partial_download.h \
295         pop.h \
296         prefs_account.h \
297         prefs_actions.h \
298         prefs_common.h \
299         prefs_compose_writing.h \
300         prefs_customheader.h \
301         prefs_display_header.h \
302         prefs_ext_prog.h \
303         prefs_filtering_action.h \
304         prefs_filtering.h \
305         prefs_folder_item.h \
306         prefs_fonts.h \
307         prefs_gtk.h \
308         prefs_image_viewer.h \
309         prefs_logging.h \
310         prefs_matcher.h \
311         prefs_message.h \
312         prefs_msg_colors.h \
313         prefs_other.h \
314         prefs_quote.h \
315         prefs_receive.h \
316         prefs_send.h \
317         prefs_spelling.h \
318         prefs_summaries.h \
319         prefs_summary_column.h \
320         prefs_summary_open.h \
321         prefs_folder_column.h \
322         prefs_template.h \
323         prefs_themes.h \
324         prefs_toolbar.h \
325         prefs_wrapping.h \
326         printing.h \
327         privacy.h \
328         procheader.h \
329         procmime.h \
330         procmsg.h \
331         proctypes.h \
332         quote_fmt.h \
333         quote_fmt_lex.h \
334         quote_fmt_parse.h \
335         recv.h \
336         remotefolder.h \
337         send_message.h \
338         setup.h \
339         sourcewindow.h \
340         ssl_manager.h \
341         statusbar.h \
342         stock_pixmap.h \
343         summary_search.h \
344         summaryview.h \
345         textview.h \
346         toolbar.h \
347         undo.h \
348         unmime.h \
349         uri_opener.h \
350         viewtypes.h \
351         wizard.h \
352         $(abook_headers)
353
354 BUILT_SOURCES = \
355         matcher_parser_parse.h \
356         quote_fmt_parse.h \
357         client-bindings.h
358
359 client-bindings.h: claws-contacts.xml
360 if BUILD_NEWADDRBOOK
361         dbus-binding-tool --prefix=abook --mode=glib-client --output=$@ claws-contacts.xml
362
363 CLEANFILES = \
364              client-bindings.h
365 endif
366
367 EXTRA_DIST = \
368         w32-logo.ico w32-resource.rc \
369         pixmaps/addr_one.xpm \
370         pixmaps/addr_two.xpm \
371         pixmaps/address_book.xpm \
372         pixmaps/address_search.xpm \
373         pixmaps/address.xpm \
374         pixmaps/anonymous.xpm \
375         pixmaps/book.xpm \
376         pixmaps/cancel.xpm \
377         pixmaps/category.xpm \
378         pixmaps/checkbox_off.xpm \
379         pixmaps/checkbox_on.xpm \
380         pixmaps/check_spelling.xpm \
381         pixmaps/clipkey.xpm \
382         pixmaps/claws-mail_icon.xpm \
383         pixmaps/claws-mail_compose_logo.xpm \
384         pixmaps/claws-mail_logo.xpm \
385         pixmaps/claws-mail_logo-small.xpm \
386         pixmaps/claws-mail.xpm \
387         pixmaps/clip.xpm \
388         pixmaps/clip_gpg_signed.xpm \
389         pixmaps/close.xpm \
390         pixmaps/complete.xpm \
391         pixmaps/continue.xpm \
392         pixmaps/delete_btn.xpm \
393         pixmaps/deleted.xpm \
394         pixmaps/dir_close.xpm \
395         pixmaps/dir_close_hrm.xpm \
396         pixmaps/dir_noselect.xpm \
397         pixmaps/dir_open_hrm.xpm \
398         pixmaps/dir_open.xpm \
399         pixmaps/down_arrow.xpm \
400         pixmaps/drafts_close.xpm \
401         pixmaps/drafts_open.xpm \
402         pixmaps/drafts_close.xpm \
403         pixmaps/drafts_open.xpm \
404         pixmaps/edit_extern.xpm \
405         pixmaps/error.xpm \
406         pixmaps/exec.xpm \
407         pixmaps/forwarded.xpm \
408         pixmaps/gpg_signed.xpm \
409         pixmaps/go_folders.xpm \
410         pixmaps/group.xpm \
411         pixmaps/ham_btn.xpm \
412         pixmaps/ignorethread.xpm \
413         pixmaps/inbox_open_hrm.xpm \
414         pixmaps/inbox_open.xpm \
415         pixmaps/inbox_close_hrm.xpm \
416         pixmaps/inbox_close.xpm \
417         pixmaps/interface.xpm \
418         pixmaps/insert_file.xpm \
419         pixmaps/jpilot.xpm \
420         pixmaps/key.xpm \
421         pixmaps/key_gpg_signed.xpm \
422         pixmaps/ldap.xpm \
423         pixmaps/linewrap.xpm \
424         pixmaps/linewrapcurrent.xpm \
425         pixmaps/locked.xpm \
426         pixmaps/mail_attach.xpm \
427         pixmaps/mail_compose.xpm \
428         pixmaps/mail_forward.xpm \
429         pixmaps/mail_receive_all.xpm \
430         pixmaps/mail_receive.xpm \
431         pixmaps/mail_reply_to_all.xpm \
432         pixmaps/mail_reply_to_author.xpm \
433         pixmaps/mail_reply_to_list.xpm \
434         pixmaps/mail_reply.xpm \
435         pixmaps/mail_send_queue.xpm \
436         pixmaps/mail_send.xpm \
437         pixmaps/mail_sign.xpm \
438         pixmaps/mail.xpm \
439         pixmaps/mark.xpm \
440         pixmaps/mime_application.xpm \
441         pixmaps/mime_audio.xpm \
442         pixmaps/mime_image.xpm \
443         pixmaps/mime_message.xpm \
444         pixmaps/mime_pdf.xpm \
445         pixmaps/mime_ps.xpm \
446         pixmaps/mime_calendar.xpm \
447         pixmaps/mime_pgpsig.xpm \
448         pixmaps/mime_text_enriched.xpm \
449         pixmaps/mime_text_html.xpm \
450         pixmaps/mime_text_patch.xpm \
451         pixmaps/mime_text_plain.xpm \
452         pixmaps/mime_unknown.xpm \
453         pixmaps/news_compose.xpm \
454         pixmaps/new.xpm \
455         pixmaps/notice_error.xpm \
456         pixmaps/notice_note.xpm \
457         pixmaps/notice_warn.xpm \
458         pixmaps/offline.xpm \
459         pixmaps/online.xpm \
460         pixmaps/open_mail.xpm \
461         pixmaps/outbox_close.xpm \
462         pixmaps/outbox_close_hrm.xpm \
463         pixmaps/outbox_open.xpm \
464         pixmaps/outbox_open_hrm.xpm \
465         pixmaps/outbox_close_mark.xpm \
466         pixmaps/outbox_close_hrm_mark.xpm \
467         pixmaps/outbox_open_mark.xpm \
468         pixmaps/outbox_open_hrm_mark.xpm \
469         pixmaps/paste.xpm \
470         pixmaps/preferences.xpm \
471         pixmaps/printer.xpm \
472         pixmaps/privacy_expired.xpm \
473         pixmaps/privacy_failed.xpm \
474         pixmaps/privacy_passed.xpm \
475         pixmaps/privacy_signed.xpm \
476         pixmaps/privacy_unknown.xpm \
477         pixmaps/privacy_warn.xpm \
478         pixmaps/privacy_emblem_encrypted.xpm \
479         pixmaps/privacy_emblem_failed.xpm \
480         pixmaps/privacy_emblem_passed.xpm \
481         pixmaps/privacy_emblem_signed.xpm \
482         pixmaps/privacy_emblem_warn.xpm \
483         pixmaps/properties.xpm \
484         pixmaps/queue_close.xpm \
485         pixmaps/queue_close_hrm.xpm \
486         pixmaps/queue_close_hrm_mark.xpm \
487         pixmaps/queue_close_mark.xpm \
488         pixmaps/queue_open.xpm \
489         pixmaps/queue_open_hrm.xpm \
490         pixmaps/queue_open_hrm_mark.xpm \
491         pixmaps/queue_open_mark.xpm \
492         pixmaps/quicksearch.xpm \
493         pixmaps/replied.xpm \
494         pixmaps/search.xpm \
495         pixmaps/selection.xpm \
496         pixmaps/spam.xpm \
497         pixmaps/spam_btn.xpm \
498         pixmaps/trash_hrm.xpm \
499         pixmaps/trash.xpm \
500         pixmaps/trash_btn.xpm \
501         pixmaps/unread.xpm \
502         pixmaps/read.xpm \
503         pixmaps/up_arrow.xpm \
504         pixmaps/vcard.xpm \
505         pixmaps/dir_close_mark.xpm \
506         pixmaps/dir_close_hrm_mark.xpm \
507         pixmaps/dir_open_hrm_mark.xpm \
508         pixmaps/dir_open_mark.xpm \
509         pixmaps/drafts_close_mark.xpm \
510         pixmaps/drafts_open_mark.xpm \
511         pixmaps/inbox_open_hrm_mark.xpm \
512         pixmaps/inbox_open_mark.xpm \
513         pixmaps/inbox_close_hrm_mark.xpm \
514         pixmaps/inbox_close_mark.xpm \
515         pixmaps/trash_hrm_mark.xpm \
516         pixmaps/trash_mark.xpm \
517         pixmaps/moved.xpm \
518         pixmaps/copied.xpm \
519         pixmaps/watchthread.xpm \
520         pixmaps/tray_newmail.offline.xpm \
521         pixmaps/tray_newmail.xpm \
522         pixmaps/tray_newmarkedmail.offline.xpm \
523         pixmaps/tray_newmarkedmail.xpm \
524         pixmaps/tray_nomail.offline.xpm \
525         pixmaps/tray_nomail.xpm \
526         pixmaps/tray_unreadmail.offline.xpm \
527         pixmaps/tray_unreadmail.xpm \
528         pixmaps/tray_unreadmarkedmail.offline.xpm \
529         pixmaps/tray_unreadmarkedmail.xpm \
530         pixmaps/empty.xpm \
531         pixmaps/replied_and_forwarded.xpm \
532         claws-contacts.xml \
533         $(abook_extra)
534
535
536 IFLAGS = \
537         -I$(srcdir)/common \
538         -Icommon \
539         -I$(srcdir)/gtk \
540         -I$(srcdir)/etpan
541
542 if PLATFORM_WIN32
543 arch_ldflags := -export-all-symbols
544 else
545 arch_ldflags :=
546 endif
547
548 claws_mail_LDFLAGS = \
549         $(arch_ldflags) -export-dynamic $(claws_mail_res_ldflag)
550
551 claws_mail_DEPENDENCIES = $(claws_mail_deps) \
552         $(etpan_library) \
553         gtk/libclawsgtk.la
554
555 claws_mail_LDADD = \
556         $(etpan_library) \
557         gtk/libclawsgtk.la \
558         $(ENCHANT_LIBS) \
559         $(INTLLIBS) \
560         $(GTK_LIBS) \
561         $(GPGME_LIBS) \
562         $(LDAP_LIBS) \
563         $(GNUTLS_LIBS) \
564         $(COMPFACE_LIBS) \
565         $(JPILOT_LIBS) \
566         $(PTHREAD_LIBS) \
567         $(SM_LIBS) \
568         $(LIBICONV) \
569         $(STARTUP_NOTIFICATION_LIBS) \
570         $(LIBETPAN_LIBS) \
571         $(DBUS_LIBS) \
572         $(CONTACTS_LIBS)
573
574 pixmapdir=$(datadir)/icons/hicolor/48x48/apps
575
576 AM_CPPFLAGS = \
577         -DG_LOG_DOMAIN=\"Claws-Mail\" \
578         -DLOCALEDIR=\""$(localedir)"\" \
579         -DPIXMAP_DIR=\""$(pixmapdir)"\" \
580         -DMANUALDIR=\""$(manualdir)"\" \
581         -DTARGET_ALIAS=\""$(target_triplet)"\" \
582         -DSYSCONFDIR=\""$(sysconfdir)"\" \
583         -DDATAROOTDIR=\""$(datarootdir)"\" \
584         $(IFLAGS) \
585         $(ENCHANT_CFLAGS) \
586         $(GTK_CFLAGS) \
587         $(GPGME_CFLAGS) \
588         $(LIBETPAN_CPPFLAGS) \
589         $(STARTUP_NOTIFICATION_CFLAGS) \
590         $(DBUS_CFLAGS) \
591         $(NETWORKMANAGER_SUPPORT_CFLAGS) \
592         $(VALGRIND_CFLAGS) \
593         $(CONTACTS_CFLAGS)
594
595 #no-unused-function is there because of bison stuff
596 #no-deprecated-declarations because of gpgme_data_rewind, which we have
597 #to call inside gpgme due to our lack of LARGEFILE support
598
599 AM_YFLAGS = -d
600
601 if CYGWIN
602 claws-mail$(EXEEXT): $(claws_mail_OBJECTS) $(claws_mail_DEPENDENCIES) 
603         @rm -f claws-mail$(EXEEXT)
604         @rm -f claws-mail.def claws-mail.base claws-mail.exp libclaws-mail.a .libs/libclaws-mail.a
605         $(LINK) -shared $(claws_mailLDFLAGS) -Wl,--out-implib=libclaws-mail.a -Wl,--export-all-symbols,--exclude-symbols,main $(claws_mail_OBJECTS) -Wl,--no-whole-archive $(claws_mail_LDADD) $(LIBS)
606         dlltool --output-def claws-mail.def --dllname claws-mail$(EXEEXT) --export-all-symbols --exclude-symbols main $(claws_mail_OBJECTS) gtk/.libs/libclawsgtk.a
607         $(LINK) $(claws_mail_LDFLAGS) -Wl,--base-file,claws-mail.base $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
608         sleep 5
609         dlltool --base-file claws-mail.base --input-def claws-mail.def --output-exp claws-mail.exp
610         $(LINK) $(claws_mail_LDFLAGS) -Wl,claws-mail.exp $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
611         @cp libclaws-mail.a .libs/libclaws-mail.a
612 else
613 #claws-mail$(EXEEXT): $(claws_mail_OBJECTS) $(claws_mail_DEPENDENCIES) 
614 #       @rm -f claws-mail$(EXEEXT)
615 #       $(LINK) $(claws_mail_LDFLAGS) $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
616 endif