Makefile 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. # vim:ts=32:noet
  2. #
  3. # Makefile for Sylpheed-Claws / Win32 / GCC
  4. # - Win32/MinGW GCC 2.95/3.2
  5. # - Cygwin/MinGW GCC 2.95/3.2
  6. # - Linux/MinGW GCC 2.95/3.2
  7. # Before building, read the README-w32.txt and
  8. # 1. Create that directory structure
  9. # 2. Set DEBUGVERSION, GCCVERSION, CYGWIN according to your environment
  10. # 3. Call "make -f Make-ming.mak"
  11. # (use mingw32-make.exe for mingw-2.0.x)
  12. #
  13. # Note:
  14. # Although this makefile doesnt make use of the shell, building under cygwin
  15. # only works from inside cygwin's bash for me. Building with the standalone
  16. # MinGW compiler works from windows commandline as well as from rxvt shipped
  17. # with MSYS.
  18. #
  19. ################################################################################
  20. # DEBUGVERSION: set to 1 to include debugging symbols
  21. DEBUGVERSION=0
  22. # GCCVERSION: set to 3 if using gcc3.x (-fnative-struct | -mms-bitfields)
  23. GCCVERSION=2
  24. # CYGWIN: set to 1 if building from cygwin shell (-mno-cygwin)
  25. CYGWIN=0
  26. # CROSS: Cross comilation prefix
  27. #CROSS=i586-mingw32msvc-
  28. # PLUGINS: Plugins that should be built
  29. PLUGINS=demo.dll spamassassin.dll spamassassin_gtk.dll
  30. ################################################################################
  31. # directory strucure as in README-w32.txt
  32. LIBDIR =../../../lib
  33. INCLUDEDIR =../../../include
  34. GLIBDIR =$(INCLUDEDIR)/glib-2.0
  35. GTKROOTDIR =$(INCLUDEDIR)/gtk-2.0
  36. GTKDIR =$(GTKROOTDIR)/gtk
  37. GDKDIR =$(GTKROOTDIR)/gdk
  38. GLIBLIBINCDIR =$(LIBDIR)/glib-2.0/include
  39. GTKLIBINCDIR =$(LIBDIR)/gtk-2.0/include
  40. ATKDIR =$(INCLUDEDIR)/atk-1.0
  41. PANGOGDIR =$(INCLUDEDIR)/pango-1.0
  42. FREETYPEDIR =$(INCLUDEDIR)/freetype2
  43. LIBPNGDIR =$(INCLUDEDIR)/libpng12
  44. FNMATCHDIR =../../fnmatch
  45. GPGMEDIR =../../gpgme
  46. LIBCOMPFACEDIR =../../libcompface
  47. OPENSSLDIR =../../openssl
  48. REGEXDIR =../../regex
  49. W32LIBDIR =../../w32lib
  50. ROOTDIR =..
  51. SRCDIR =$(ROOTDIR)/src
  52. PODIR =$(ROOTDIR)/po
  53. SRCDIR_ESC =\.\.\/src\/
  54. ################################################################################
  55. ifeq ($(DEBUGVERSION),1)
  56. DEBUGFLAG=-g
  57. DEBUGDEF=-D_DEBUG
  58. APPNAME=sylpheed_d
  59. else
  60. NOCONSOLE=-mwindows
  61. # OPTIMIZATION=-O3
  62. APPNAME=sylpheed
  63. endif
  64. ifeq ($(GCCVERSION),3)
  65. # gcc-3.x: -mms-bitfields
  66. BITFIELD=-mms-bitfields
  67. else
  68. # gcc-2.x: -fnative-struct
  69. BITFIELD=-fnative-struct
  70. INTLFIX=-D_INTL_REDIRECT_INLINE
  71. endif
  72. ifeq ($(CYGWIN),1)
  73. # cygwin: built native w32 code
  74. NOCYGWIN=-mno-cygwin
  75. endif
  76. ################################################################################
  77. CC=$(CROSS)gcc
  78. RESCOMP=$(CROSS)windres
  79. FLEX=flex
  80. YACC=bison -y
  81. MSGFMT=msgfmt
  82. ICONV=iconv
  83. SED=sed
  84. CD=cd
  85. RM=rm
  86. ###
  87. VPATH=$(SRCDIR):$(SRCDIR)/common:$(SRCDIR)/gtk:$(PODIR):$(SRCDIR)/plugins/demo:$(SRCDIR)/plugins/spamassassin:$(SRCDIR)/plugins/pgpmime
  88. DEFINES=-DHAVE_CONFIG_H -DHAVE_BYTE_TYPEDEF $(INTLFIX) $(DEBUGDEF)
  89. EXTRALIBS=-lws2_32
  90. RESOURCE=appicon
  91. FLAGS=$(DEBUGFLAG) $(BITFIELD) $(NOCYGWIN) $(OPTIMIZATION)
  92. ### version
  93. CONFIGURE_AC=$(ROOTDIR)/configure.ac
  94. VERSION_H_IN=$(SRCDIR)/common/version.h.in
  95. VERSION_H=$(SRCDIR)/common/version.h
  96. PACKAGE=$(shell grep ^PACKAGE= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  97. MAJOR_VERSION=$(shell grep ^MAJOR_VERSION= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  98. MINOR_VERSION=$(shell grep ^MINOR_VERSION= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  99. MICRO_VERSION=$(shell grep ^MICRO_VERSION= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  100. EXTRA_VERSION=$(shell grep ^EXTRA_VERSION= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  101. EXTRA_WIN32_VERSION=$(shell grep ^EXTRA_WIN32_VERSION= $(CONFIGURE_AC)|sed -e "s/.*=//" -)
  102. ifeq ($(EXTRA_VERSION),0)
  103. VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(EXTRA_WIN32_VERSION)
  104. else
  105. VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)cvs$(EXTRA_VERSION)$(EXTRA_WIN32_VERSION)
  106. endif
  107. ### password encryption
  108. PASSCRYPT_KEY=passkey0
  109. PASSCRYPT_H=$(SRCDIR)/common/passcrypt.h
  110. PASSCRYPT_H_IN=$(PASSCRYPT_H).in
  111. ### bisonfiles
  112. # names of parser output files and escaped versions
  113. LEX_YY_C=lex.yy.c
  114. Y_TAB_C=y.tab.c
  115. Y_TAB_H=y.tab.h
  116. LEX_YY_C_ESC=lex\.yy\.c
  117. Y_TAB_C_ESC=y\.tab\.c
  118. Y_TAB_H_ESC=y\.tab\.h
  119. QUOTE_FMT=$(SRCDIR)/quote_fmt
  120. MATCHER_PARSER=$(SRCDIR)/matcher_parser
  121. QUOTE_FMT_TARGETS=$(QUOTE_FMT)_lex.c $(QUOTE_FMT)_parse.c $(QUOTE_FMT)_parse.h
  122. MATCHER_PARSER_TARGETS=$(MATCHER_PARSER)_lex.c $(MATCHER_PARSER)_parse.c $(MATCHER_PARSER)_parse.h
  123. ### translation
  124. MOFILES=bg.mo cs.mo de.mo el.mo en_GB.mo es.mo fr.mo hr.mo hu.mo it.mo ja.mo ko.mo nl.mo pl.mo pt_BR.mo ru.mo sk.mo sr.mo sv.mo zh_CN.mo zh_TW.Big5.mo
  125. MONAME=sylpheed.mo
  126. # avoid check for backslash, different shells need different escaping. yucc!
  127. CHARSET_RE=\(.*Content-Type: text\/plain; charset=\)\([-a-zA-Z0-9]*\)\(.*\)
  128. ### sylpheed
  129. INCLUDES= \
  130. -I. \
  131. -I$(SRCDIR) \
  132. -I$(SRCDIR)/common \
  133. -I$(SRCDIR)/gtk \
  134. -I$(INCLUDEDIR) \
  135. -I$(GLIBDIR) \
  136. -I$(GTKROOTDIR) \
  137. -I$(GTKDIR) \
  138. -I$(GDKDIR) \
  139. -I$(GLIBLIBINCDIR) \
  140. -I$(GTKLIBINCDIR) \
  141. -I$(ATKDIR) \
  142. -I$(PANGOGDIR) \
  143. -I$(FREETYPEDIR) \
  144. -I$(LIBPNGDIR) \
  145. -I$(W32LIBDIR)/src \
  146. APP_INCLUDES= \
  147. -I$(FNMATCHDIR)/src/posix \
  148. -I$(GPGMEDIR)/gpgme \
  149. -I$(LIBCOMPFACEDIR)/src \
  150. -I$(OPENSSLDIR)/src \
  151. -I$(REGEXDIR)/src
  152. CFLAGS=$(FLAGS) $(DEFINES) $(INCLUDES) $(APP_INCLUDES)
  153. PLUGIN_CFLAGS=$(FLAGS) $(DEFINES) $(INCLUDES)
  154. LIBS= \
  155. $(LIBDIR)/glib-2.0.lib \
  156. $(LIBDIR)/gmodule-2.0.lib \
  157. $(LIBDIR)/gobject-2.0.lib \
  158. $(LIBDIR)/gdk-win32-2.0.lib \
  159. $(LIBDIR)/gtk-win32-2.0.lib \
  160. $(LIBDIR)/pangowin32-1.0.lib \
  161. $(LIBDIR)/pango-1.0.lib \
  162. $(LIBDIR)/iconv.lib \
  163. $(LIBDIR)/intl.lib \
  164. $(LIBDIR)/libeay32.lib \
  165. $(LIBDIR)/ssleay32.lib \
  166. $(LIBDIR)/RSAglue.lib \
  167. $(LIBDIR)/libcrypt.lib \
  168. $(LIBDIR)/pthreadVC.lib \
  169. $(LIBDIR)/libjconv.lib \
  170. $(FNMATCHDIR)/fnmatch.lib \
  171. $(GPGMEDIR)/gpgme.lib \
  172. $(LIBCOMPFACEDIR)/libcompface.lib \
  173. $(REGEXDIR)/regex.lib \
  174. $(W32LIBDIR)/w32lib.lib
  175. OBJECTS= \
  176. about.o \
  177. account.o \
  178. action.o \
  179. addr_compl.o \
  180. addrbook.o \
  181. addrcache.o \
  182. addrcindex.o \
  183. addrclip.o \
  184. addressadd.o \
  185. addressbook.o \
  186. addrgather.o \
  187. addrharvest.o \
  188. addrindex.o \
  189. addritem.o \
  190. addrquery.o \
  191. addrselect.o \
  192. alertpanel.o \
  193. base64.o \
  194. codeconv.o \
  195. colorlabel.o \
  196. colorsel.o \
  197. compose.o \
  198. customheader.o \
  199. description_window.o \
  200. displayheader.o \
  201. editaddress.o \
  202. editbook.o \
  203. editgroup.o \
  204. editjpilot.o \
  205. editldap.o \
  206. editldap_basedn.o \
  207. editvcard.o \
  208. enriched.o \
  209. exphtmldlg.o \
  210. expldifdlg.o \
  211. export.o \
  212. exporthtml.o \
  213. exportldif.o \
  214. filtering.o \
  215. folder.o \
  216. folder_item_prefs.o \
  217. foldersel.o \
  218. foldersort.o \
  219. folderutils.o \
  220. folderview.o \
  221. grouplistdialog.o \
  222. gtkaspell.o \
  223. gtksctree.o \
  224. gtkshruler.o \
  225. gtkutils.o \
  226. gtkvscrollbutton.o \
  227. headerview.o \
  228. hooks.o \
  229. html.o \
  230. imap.o \
  231. imap_gtk.o \
  232. import.o \
  233. importldif.o \
  234. importmutt.o \
  235. importpine.o \
  236. inc.o \
  237. inputdialog.o \
  238. jpilot.o \
  239. ldapctrl.o \
  240. ldapquery.o \
  241. ldapserver.o \
  242. ldaputil.o \
  243. ldif.o \
  244. localfolder.o \
  245. log.o \
  246. logwindow.o \
  247. main.o \
  248. mainwindow.o \
  249. manage_window.o \
  250. manual.o \
  251. matcher.o \
  252. matcher_parser_lex.o \
  253. matcher_parser_parse.o \
  254. mbox.o \
  255. md5.o \
  256. menu.o \
  257. message_search.o \
  258. messageview.o \
  259. mgutils.o \
  260. mh.o \
  261. mh_gtk.o \
  262. mimeview.o \
  263. msgcache.o \
  264. mutt.o \
  265. news.o \
  266. news_gtk.o \
  267. nntp.o \
  268. noticeview.o \
  269. partial_download.o \
  270. passcrypt.o \
  271. pine.o \
  272. plugin.o \
  273. pluginwindow.o \
  274. pop.o \
  275. privacy.o \
  276. prefs.o \
  277. prefs_account.o \
  278. prefs_actions.o \
  279. prefs_common.o \
  280. prefs_customheader.o \
  281. prefs_display_header.o \
  282. prefs_ext_prog.o \
  283. prefs_filtering.o \
  284. prefs_filtering_action.o \
  285. prefs_folder_item.o \
  286. prefs_fonts.o \
  287. prefs_gtk.o \
  288. prefs_matcher.o \
  289. prefs_msg_colors.o \
  290. prefs_spelling.o \
  291. prefs_summary_column.o \
  292. prefs_template.o \
  293. prefs_themes.o \
  294. prefs_toolbar.o \
  295. prefs_wrapping.o \
  296. prefswindow.o \
  297. procheader.o \
  298. procmime.o \
  299. procmsg.o \
  300. progressdialog.o \
  301. progressindicator.o \
  302. quicksearch.o \
  303. quote_fmt.o \
  304. quote_fmt_lex.o \
  305. quote_fmt_parse.o \
  306. quoted-printable.o \
  307. recv.o \
  308. remotefolder.o \
  309. send_message.o \
  310. setup.o \
  311. simple-gettext.o \
  312. smtp.o \
  313. socket.o \
  314. sourcewindow.o \
  315. ssl.o \
  316. ssl_certificate.o \
  317. ssl_manager.o \
  318. sslcertwindow.o \
  319. statusbar.o \
  320. stock_pixmap.o \
  321. string_match.o \
  322. stringtable.o \
  323. summary_search.o \
  324. summaryview.o \
  325. syldap.o \
  326. sylpheed.o \
  327. sylpheed-marshal.o \
  328. template.o \
  329. textview.o \
  330. toolbar.o \
  331. undo.o \
  332. unmime.o \
  333. utils.o \
  334. uuencode.o \
  335. vcard.o \
  336. w32_aspell_init.o \
  337. w32_filesel.o \
  338. w32_mailcap.o \
  339. w32_session.o \
  340. wizard.o \
  341. xml.o \
  342. xmlprops.o \
  343. ### targets
  344. all: version_rc version bisonfiles compile translation
  345. compile: $(APPNAME).dll $(APPNAME).exe $(PLUGINS)
  346. version: $(VERSION_H)
  347. bisonfiles: $(QUOTE_FMT_TARGETS) $(MATCHER_PARSER_TARGETS)
  348. translation: $(MOFILES)
  349. version_rc: version.rc demo_version.rc spamassassin_version.rc pgpmime_version.rc image_viewer_version.rc
  350. ### version resource files
  351. version.rc.in: version.rc.in.in $(CONFIGURE_AC)
  352. echo a
  353. $(SED) -e "s/@MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@MINOR_VERSION@/$(MINOR_VERSION)/;s/@MICRO_VERSION@/$(MICRO_VERSION)/;s/@EXTRA_VERSION@/$(EXTRA_VERSION)/;" $< > $@
  354. version.rc: version.rc.in
  355. echo b
  356. $(SED) -e "s/@FILEDESCRIPTION@/Sylpheed-Claws/;s/@FILE_MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@FILE_MINOR_VERSION@/$(MINOR_VERSION)/;s/@FILE_MICRO_VERSION@/$(MICRO_VERSION)/;s/@FILE_EXTRA_VERSION@/$(EXTRA_VERSION)/" $< > $@
  357. demo_version.rc: version.rc.in
  358. echo c
  359. $(SED) -e "s/@FILEDESCRIPTION@/Demo-Plugin/;s/@FILE_MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@FILE_MINOR_VERSION@/$(MINOR_VERSION)/;s/@FILE_MICRO_VERSION@/$(MICRO_VERSION)/;s/@FILE_EXTRA_VERSION@/$(EXTRA_VERSION)/" $< > $@
  360. spamassassin_version.rc: version.rc.in
  361. echo d
  362. $(SED) -e "s/@FILEDESCRIPTION@/SpamAssassin-Plugin/;s/@FILE_MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@FILE_MINOR_VERSION@/$(MINOR_VERSION)/;s/@FILE_MICRO_VERSION@/$(MICRO_VERSION)/;s/@FILE_EXTRA_VERSION@/$(EXTRA_VERSION)/" $< > $@
  363. image_viewer_version.rc: version.rc.in
  364. echo e
  365. $(SED) -e "s/@FILEDESCRIPTION@/Image-Viewer-Plugin/;s/@FILE_MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@FILE_MINOR_VERSION@/$(MINOR_VERSION)/;s/@FILE_MICRO_VERSION@/$(MICRO_VERSION)/;s/@FILE_EXTRA_VERSION@/$(EXTRA_VERSION)/" $< > $@
  366. version.res: version.rc
  367. ### plugins
  368. ### pgpmime
  369. #plugin.o: plugin.c
  370. passphrase.o: passphrase.c passphrase.h
  371. pgpmime.o: pgpmime.c pgpmime.h
  372. prefs_gpg.o: prefs_gpg.c prefs_gpg.h
  373. select-keys.o: select-keys.c select-keys.h
  374. sgpgme.o: sgpgme.c sgpgme.h
  375. pgpmime_plugin.c:
  376. cp $(SRCDIR)/plugins/pgpmime/plugin.c $(SRCDIR)/plugins/pgpmime/$@
  377. pgpmime_plugin.o: $(SRCDIR)/plugins/pgpmime/pgpmime_plugin.c
  378. pgpmime_version.rc.o: pgpmime_version.rc
  379. $(RESCOMP) -i $< -o $@
  380. pgpmime_LIBS = $(APPNAME).dll $(GPGMEDIR)/gpgme.lib $(EXTRALIBS) $(LIBS)
  381. pgpmime_OBJECTS = \
  382. pgpmime_plugin.o \
  383. passphrase.o \
  384. pgpmime.o \
  385. prefs_gpg.o \
  386. select-keys.o \
  387. sgpgme.o \
  388. pgpmime_version.rc.o
  389. pgpmime.dll: $(pgpmime_OBJECTS)
  390. dlltool -D $@ -z $@.def --export-all-symbols --exclude-symbols WinMain@16 $(pgpmime_OBJECTS)
  391. $(CC) -mdll $(PLUGIN_CFLAGS) -o junk.tmp -Wl,--base-file,$@.base $(pgpmime_OBJECTS) $(pgpmime_LIBS)
  392. dlltool --dllname $@ --base-file $@.base --output-exp $@.exp --def $@.def
  393. $(CC) -mdll $(PLUGIN_CFLAGS) -o $@ $(pgpmime_OBJECTS) -Wl,$@.exp $(pgpmime_LIBS)
  394. -rm $@.base $@.exp $@.lib junk.tmp
  395. #$(CC) -shared $? $(APPNAME).dll $(LIBDIR)/intl.lib /dev/lib/libglib-2.0.dll.a /dev/lib/libgtk.dll.a -o $@
  396. pgpmime_clean:
  397. -rm $(pgpmime_OBJECTS)
  398. ### spamassassin
  399. spamassassin.o: spamassassin.c spamassassin.h
  400. libspamc.o: libspamc.c libspamc.h
  401. #utils.o: utils.c utils.h
  402. libspamc_utils.o: libspamc_utils.c $(SRCDIR)/plugins/spamassassin/utils.h
  403. $(CC) $(PLUGIN_CFLAGS) -c -o $@ $<
  404. libspamc_utils.c: libspamc_utils.h
  405. cp $(SRCDIR)/plugins/spamassassin/utils.c $@
  406. libspamc_utils.h:
  407. cp $(SRCDIR)/plugins/spamassassin/utils.h $@
  408. spamassassin_version.rc.o: spamassassin_version.rc
  409. $(RESCOMP) -i $< -o $@
  410. #spamassassin_LIBS = $(APPNAME).dll -lwsock32 $(EXTRALIBS) $(LIBS)
  411. spamassassin_LIBS = $(APPNAME).dll -lws2_32 $(windir)/system32/ws2_32.dll $(LIBS)
  412. spamassassin_OBJECTS = \
  413. spamassassin.o \
  414. libspamc.o \
  415. libspamc_utils.o \
  416. spamassassin_version.rc.o
  417. spamassassin.dll: libspamc_utils.c $(spamassassin_OBJECTS)
  418. dlltool -D $@ -z $@.def --export-all-symbols --exclude-symbols WinMain@16 $(spamassassin_OBJECTS)
  419. $(CC) -mdll -o junk.tmp -Wl,--base-file,$@.base $(spamassassin_OBJECTS) $(spamassassin_LIBS)
  420. dlltool --dllname $@ --base-file $@.base --output-exp $@.exp --def $@.def
  421. $(CC) -mdll -o $@ $(spamassassin_OBJECTS) -Wl,$@.exp $(spamassassin_LIBS)
  422. -rm $@.base $@.exp $@.lib junk.tmp
  423. #-rm $@.def $@.base $@.exp $@.lib junk.tmp
  424. #$(CC) -shared $? $(APPNAME).dll -lwsock32 /dev/lib/libglib-2.0.dll.a -o $@
  425. spamassassin_clean:
  426. -rm $(spamassassin_OBJECTS) libspamc_utils.c libspamc_utils.h libspamc_utils.o
  427. ### spamassassin (gui)
  428. spamassassin_gtk.o: spamassassin_gtk.c spamassassin.h
  429. spamassassin_gtk_LIBS = $(APPNAME).dll spamassassin.dll $(EXTRALIBS) $(LIBS)
  430. spamassassin_gtk_OBJECTS = \
  431. spamassassin_gtk.o \
  432. spamassassin_version.rc.o
  433. spamassassin_gtk.dll: $(spamassassin_gtk_OBJECTS)
  434. dlltool -D $@ -z $@.def --export-all-symbols --exclude-symbols WinMain@16 $(spamassassin_gtk_OBJECTS)
  435. $(CC) -mdll $(PLUGIN_CFLAGS) -o junk.tmp -Wl,--base-file,$@.base $(spamassassin_gtk_OBJECTS) $(spamassassin_gtk_LIBS)
  436. dlltool --dllname $@ --base-file $@.base --output-exp $@.exp --def $@.def
  437. $(CC) -mdll $(PLUGIN_CFLAGS) -o $@ $(spamassassin_gtk_OBJECTS) -Wl,$@.exp $(spamassassin_gtk_LIBS)
  438. -rm $@.base $@.exp $@.lib junk.tmp
  439. #$(CC) -shared $? $(APPNAME).dll spamassassin.dll $(LIBDIR)/intl.lib /dev/lib/libglib-2.0.dll.a /dev/lib/libgtk.dll.a -o $@
  440. spamassassin_gtk_clean:
  441. -rm $(spamassassin_gtk_OBJECTS)
  442. ### demo plugin
  443. demo.o: demo.c
  444. demo_version.rc.o: demo_version.rc
  445. $(RESCOMP) -i $< -o $@
  446. demo_LIBS = $(APPNAME).dll $(EXTRALIBS) $(LIBS)
  447. demo_OBJECTS = \
  448. demo.o \
  449. demo_version.rc.o
  450. demo.dll: $(demo_OBJECTS)
  451. dlltool -D $@ -z $@.def --export-all-symbols --exclude-symbols WinMain@16 $(demo_OBJECTS)
  452. $(CC) -mdll $(PLUGIN_CFLAGS) -o junk.tmp -Wl,--base-file,$@.base $(demo_OBJECTS) $(demo_LIBS)
  453. dlltool --dllname $@ --base-file $@.base --output-exp $@.exp --def $@.def
  454. $(CC) -mdll $(PLUGIN_CFLAGS) -o $@ $(demo_OBJECTS) -Wl,$@.exp $(demo_LIBS)
  455. -rm $@.base $@.exp $@.lib junk.tmp
  456. #$(CC) -shared demo.o $(APPNAME).dll /dev/lib/libglib-2.0.dll.a -o $@
  457. demo_clean:
  458. -rm demo.o
  459. ### sylpheed.dll (main)
  460. $(APPNAME).dll: $(OBJECTS) version.rc.o $(APPNAME).dll.def $(APPNAME).dll.base $(APPNAME).dll.exp #$(APPNAME).dll.lib
  461. $(CC) -mdll $(FLAGS) -o $@ $(OBJECTS) version.rc.o -Wl,$@.exp $(EXTRALIBS) $(LIBS)
  462. -rm $@.base $@.exp $@.lib junk.tmp
  463. $(APPNAME).dll.def:
  464. dlltool -D $(APPNAME).dll -z $@ --export-all-symbols --exclude-symbols WinMain@16 $(OBJECTS)
  465. $(APPNAME).dll.base:
  466. $(CC) -mdll $(FLAGS) -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(EXTRALIBS) $(LIBS)
  467. $(APPNAME).dll.exp:
  468. dlltool --dllname $(APPNAME).dll --base-file $(APPNAME).dll.base --output-exp $@ --def $(APPNAME).dll.def
  469. $(APPNAME).dll.lib:
  470. dlltool -D main.dll -d main.def -l $@
  471. version.rc.o: version.rc
  472. $(RESCOMP) -i $< -o $@
  473. ### sylpheed.exe (loader)
  474. w32_loader.o: w32_loader.c
  475. loader_OBJECTS= w32_loader.o
  476. $(APPNAME).exe: $(loader_OBJECTS) $(RESOURCE).o
  477. $(CC) $(NOCONSOLE) $(FLAGS) -L. -l$(APPNAME) $? $(EXTRALIBS) $(LIBS) -o $@
  478. $(RESOURCE).o: $(RESOURCE).rc version.rc
  479. $(RESCOMP) -i $< -o $@
  480. ### version number
  481. $(VERSION_H): $(CONFIGURE_AC) $(VERSION_H_IN)
  482. echo Version: $(PACKAGE) $(VERSION)
  483. $(SED) -e "s/@PACKAGE@/$(PACKAGE)/;s/@VERSION@/$(VERSION)/;s/@MAJOR_VERSION@/$(MAJOR_VERSION)/;s/@MINOR_VERSION@/$(MINOR_VERSION)/;s/@MICRO_VERSION@/$(MICRO_VERSION)/;s/@EXTRA_VERSION@/$(EXTRA_VERSION)/;" \
  484. $(VERSION_H_IN) > $@
  485. ### password encryption
  486. $(PASSCRYPT_H): $(PASSCRYPT_H_IN)
  487. $(SED) -e "s/@PASSCRYPT_KEY@/$(PASSCRYPT_KEY)/" $(PASSCRYPT_H_IN) > $@
  488. ### translations
  489. %.mo: $(PODIR)/%.po
  490. @# change Content-Type to "utf-8" (needed for unix msgfmt)
  491. $(SED) -e "/$(CHARSET_RE)/ s/$(CHARSET_RE)/\1utf-8\3/; " $< > $(*F)-tmp.po
  492. @# convert to utf-8, extract unmodified charset from original .po
  493. $(ICONV) -f $(shell sed -n -e "/$(CHARSET_RE)/ {s/$(CHARSET_RE)/\2/;p;} " $<) -t utf-8 $(*F)-tmp.po > $(*F)-utf8.po
  494. @# create final .mo file
  495. $(MSGFMT) -o $@ $(*F)-utf8.po
  496. @# cleanup
  497. @-$(RM) $(*F)-tmp.po $(*F)-utf8.po
  498. ### parser generated
  499. %_lex.c: $(SRCDIR)/%_lex.l
  500. $(FLEX) $(SRCDIR)/$(*F)_lex.l
  501. $(SED) -e "s/$(SRCDIR_ESC)//;s/$(LEX_YY_C_ESC)/$(@F)/" $(LEX_YY_C) > $(SRCDIR)/$(*F)_lex.c
  502. %_parse.c %_parse.h: $(SRCDIR)/%_parse.y
  503. $(YACC) -d $(SRCDIR)/$(*F)_parse.y
  504. $(SED) -e "s/$(Y_TAB_C_ESC)/$(*F)_parse.c/" $(Y_TAB_C) > $(SRCDIR)/$(*F)_parse.c
  505. $(SED) -e "s/$(Y_TAB_H_ESC)/$(*F)_parse.h/" $(Y_TAB_H) > $(SRCDIR)/$(*F)_parse.h
  506. # hack: prevent autogeneration
  507. %_lex.l %_parse.y:
  508. @echo dummy:$@
  509. ### cleanup
  510. clean: demo_clean spamassassin_clean spamassassin_gtk_clean
  511. -$(RM) *.o $(APPNAME)
  512. -$(RM) $(LEX_YY_C) $(Y_TAB_C) $(Y_TAB_H)
  513. -$(CD) $(SRCDIR); $(RM) $(QUOTE_FMT_TARGETS) $(MATCHER_PARSER_TARGETS)
  514. ### dependencies
  515. # sylpheed
  516. about.o: about.c about.h
  517. account.o: account.c account.h
  518. action.o: action.c action.h
  519. addr_compl.o: addr_compl.c addr_compl.h
  520. addrbook.o: addrbook.c addrbook.h
  521. addrcache.o: addrcache.c addrcache.h
  522. addrcindex.o: addrcindex.c addrcindex.h
  523. addrclip.o: addrclip.c addrclip.h
  524. addressadd.o: addressadd.c addressadd.h
  525. addressbook.o: addressbook.c addressbook.h
  526. addrgather.o: addrgather.c addrgather.h
  527. addrharvest.o: addrharvest.c addrharvest.h
  528. addrindex.o: addrindex.c addrindex.h
  529. addritem.o: addritem.c addritem.h
  530. addrquery.o: addrquery.c addrquery.h
  531. addrselect.o: addrselect.c addrselect.h
  532. alertpanel.o: alertpanel.c alertpanel.h
  533. base64.o: base64.c base64.h
  534. codeconv.o: codeconv.c codeconv.h
  535. colorlabel.o: colorlabel.c colorlabel.h
  536. colorsel.o: colorsel.c colorsel.h
  537. compose.o: compose.c compose.h
  538. customheader.o: customheader.c customheader.h
  539. description_window.o: description_window.c description_window.h
  540. displayheader.o: displayheader.c displayheader.h
  541. editaddress.o: editaddress.c editaddress.h
  542. editbook.o: editbook.c editbook.h
  543. editgroup.o: editgroup.c editgroup.h
  544. editjpilot.o: editjpilot.c editjpilot.h
  545. editldap.o: editldap.c editldap.h
  546. editldap_basedn.o: editldap_basedn.c editldap_basedn.h
  547. editvcard.o: editvcard.c editvcard.h
  548. enriched.o: enriched.c enriched.h
  549. exphtmldlg.o: exphtmldlg.c exphtmldlg.h
  550. expldifdlg.o: expldifdlg.c expldifdlg.h
  551. export.o: export.c export.h
  552. exporthtml.o: exporthtml.c exporthtml.h
  553. exportldif.o: exportldif.c exportldif.h
  554. filtering.o: filtering.c filtering.h
  555. folder.o: folder.c folder.h
  556. folder_item_prefs.o: folder_item_prefs.c folder_item_prefs.h
  557. foldersel.o: foldersel.c foldersel.h
  558. foldersort.o: foldersort.c foldersort.h
  559. folderutils.o: folderutils.c folderutils.h
  560. folderview.o: folderview.c folderview.h
  561. grouplistdialog.o: grouplistdialog.c grouplistdialog.h
  562. gtkaspell.o: gtkaspell.c gtkaspell.h
  563. gtksctree.o: gtksctree.c gtksctree.h
  564. gtkshruler.o: gtkshruler.c gtkshruler.h
  565. gtkutils.o: gtkutils.c gtkutils.h
  566. gtkvscrollbutton.o: gtkvscrollbutton.c gtkvscrollbutton.h
  567. headerview.o: headerview.c headerview.h
  568. hooks.o: hooks.c hooks.h
  569. html.o: html.c html.h
  570. imap.o: imap.c imap.h
  571. imap_gtk.o: imap_gtk.c imap_gtk.h
  572. import.o: import.c import.h
  573. importldif.o: importldif.c importldif.h
  574. importmutt.o: importmutt.c importmutt.h
  575. importpine.o: importpine.c importpine.h
  576. inc.o: inc.c inc.h
  577. inputdialog.o: inputdialog.c inputdialog.h
  578. jpilot.o: jpilot.c jpilot.h
  579. ldapctrl.o: ldapctrl.c ldapctrl.h
  580. ldapquery.o: ldapquery.c ldapquery.h
  581. ldapserver.o: ldapserver.c ldapserver.h
  582. ldaputil.o: ldaputil.c ldaputil.h
  583. ldif.o: ldif.c ldif.h
  584. localfolder.o: localfolder.c localfolder.h
  585. log.o: log.c log.h
  586. logwindow.o: logwindow.c logwindow.h
  587. main.o: main.c main.h
  588. mainwindow.o: mainwindow.c mainwindow.h
  589. manage_window.o: manage_window.c manage_window.h
  590. manual.o: manual.c manual.h
  591. matcher.o: matcher.c matcher.h
  592. mbox.o: mbox.c mbox.h
  593. md5.o: md5.c md5.h
  594. menu.o: menu.c menu.h
  595. message_search.o: message_search.c message_search.h
  596. messageview.o: messageview.c messageview.h
  597. mgutils.o: mgutils.c mgutils.h
  598. mh.o: mh.c mh.h
  599. mh_gtk.o: mh_gtk.c mh_gtk.h
  600. mimeview.o: mimeview.c mimeview.h
  601. msgcache.o: msgcache.c msgcache.h
  602. mutt.o: mutt.c mutt.h
  603. news.o: news.c news.h
  604. news_gtk.o: news_gtk.c news_gtk.h
  605. nntp.o: nntp.c nntp.h
  606. noticeview.o: noticeview.c noticeview.h
  607. partial_download.o: partial_download.c partial_download.h
  608. passcrypt.o: passcrypt.c passcrypt.h
  609. pine.o: pine.c pine.h
  610. plugin.o: plugin.c plugin.h
  611. pluginwindow.o: pluginwindow.c pluginwindow.h
  612. pop.o: pop.c pop.h
  613. privacy.o: privacy.c privacy.h
  614. prefs.o: prefs.c prefs.h
  615. prefs_account.o: prefs_account.c prefs_account.h
  616. prefs_actions.o: prefs_actions.c prefs_actions.h
  617. prefs_common.o: prefs_common.c prefs_common.h
  618. prefs_customheader.o: prefs_customheader.c prefs_customheader.h
  619. prefs_display_header.o: prefs_display_header.c prefs_display_header.h
  620. prefs_ext_prog.o: prefs_ext_prog.c prefs_ext_prog.h
  621. prefs_filtering.o: prefs_filtering.c prefs_filtering.h
  622. prefs_filtering_action.o: prefs_filtering_action.c prefs_filtering_action.h
  623. prefs_folder_item.o: prefs_folder_item.c prefs_folder_item.h
  624. prefs_fonts.o: prefs_fonts.c prefs_fonts.h
  625. prefs_gtk.o: prefs_gtk.c prefs_gtk.h
  626. prefs_matcher.o: prefs_matcher.c prefs_matcher.h
  627. prefs_msg_colors.o: prefs_msg_colors.c prefs_msg_colors.h
  628. prefs_spelling.o: prefs_spelling.c prefs_spelling.h
  629. prefs_summary_column.o: prefs_summary_column.c prefs_summary_column.h
  630. prefs_template.o: prefs_template.c prefs_template.h
  631. prefs_themes.o: prefs_themes.c prefs_themes.h
  632. prefs_toolbar.o: prefs_toolbar.c prefs_toolbar.h
  633. prefs_wrapping.o: prefs_wrapping.c prefs_wrapping.h
  634. prefswindow.o: prefswindow.c prefswindow.h
  635. procheader.o: procheader.c procheader.h
  636. procmime.o: procmime.c procmime.h
  637. procmsg.o: procmsg.c procmsg.h
  638. progressdialog.o: progressdialog.c progressdialog.h
  639. progressindicator.o: progressindicator.c progressindicator.h
  640. quicksearch.o: quicksearch.c quicksearch.h
  641. quote_fmt.o: quote_fmt.c quote_fmt.h
  642. recv.o: recv.c recv.h
  643. remotefolder.o: remotefolder.c remotefolder.h
  644. send_message.o: send_message.c send_message.h
  645. setup.o: setup.c setup.h
  646. simple-gettext.o: simple-gettext.c
  647. smtp.o: smtp.c smtp.h
  648. socket.o: socket.c socket.h
  649. sourcewindow.o: sourcewindow.c sourcewindow.h
  650. ssl.o: ssl.c ssl.h
  651. ssl_certificate.o: ssl_certificate.c ssl_certificate.h
  652. ssl_manager.o: ssl_manager.c ssl_manager.h
  653. sslcertwindow.o: sslcertwindow.c sslcertwindow.h
  654. statusbar.o: statusbar.c statusbar.h
  655. stock_pixmap.o: stock_pixmap.c stock_pixmap.h
  656. string_match.o: string_match.c string_match.h
  657. stringtable.o: stringtable.c stringtable.h
  658. summary_search.o: summary_search.c summary_search.h
  659. summaryview.o: summaryview.c summaryview.h
  660. syldap.o: syldap.c syldap.h
  661. sylpheed.o: sylpheed.c sylpheed.h
  662. sylpheed-marshal.o: sylpheed-marshal.c sylpheed-marshal.h
  663. template.o: template.c template.h
  664. textview.o: textview.c textview.h
  665. toolbar.o: toolbar.c toolbar.h
  666. undo.o: undo.c undo.h
  667. unmime.o: unmime.c unmime.h
  668. utils.o: utils.c utils.h
  669. uuencode.o: uuencode.c uuencode.h
  670. vcard.o: vcard.c vcard.h
  671. wizard.o: wizard.c wizard.h
  672. xml.o: xml.c xml.h
  673. xmlprops.o: xmlprops.c xmlprops.h
  674. # bison / flex generated
  675. matcher_parser_lex.o: matcher_parser_lex.c matcher_parser_lex.h
  676. matcher_parser_parse.o: matcher_parser_parse.c matcher_parser_parse.h
  677. quote_fmt_lex.o: quote_fmt_lex.c quote_fmt_lex.h
  678. quote_fmt_parse.o: quote_fmt_parse.c quote_fmt_parse.h
  679. quoted-printable.o: quoted-printable.c quoted-printable.h
  680. # win32 additions
  681. w32_aspell_init.o: w32_aspell_init.c w32_aspell_init.h
  682. w32_filesel.o: w32_filesel.c w32_filesel.h filesel.h
  683. w32_mailcap.o: w32_mailcap.c w32_mailcap.h
  684. w32_session.o: w32_session.c w32_session.h session.h