Update plugin makefiles for Windows
[claws.git] / src / plugins / pgpinline / Makefile.am
index 01931ea2e1dcb52aee8a6bc7a2c8e22e92244204..ad4c675558d47e0ea831bab830f4bfa32a535b44 100644 (file)
@@ -1,31 +1,21 @@
-# Copyright 1999-2014 the Claws Mail team.
+# Copyright 1999-2021 the Claws Mail team.
 # This file is part of Claws Mail package, and distributed under the
 # terms of the General Public License version 3 (or later).
 # See COPYING file for license details.
 
-EXTRA_DIST = version.rc plugin.def claws.def mypgpcore.def pgpinline.deps
+EXTRA_DIST = claws.def plugin.def mypgpcore.def pgpinline.deps
 
 IFLAGS = \
+       -I$(top_builddir)/src/common \
        -I$(top_srcdir)/src \
        -I$(top_srcdir)/src/common \
-       -I$(top_builddir)/src/common \
        -I$(top_srcdir)/src/gtk
 
-if OS_WIN32
+plugin_ldflags =
+plugin_extra_deps =
+plugin_libadd =
 
-LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
-     `echo $(DEFS) $(DEFAULT_INCLUDES) $(IFLAGS) | \
-     sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
-
-%.lo : %.rc
-       $(LTRCCOMPILE) -i $< -o $@
-
-plugin_res = version.lo
-plugin_res_ldflag = -Wl,.libs/version.o
-
-export_symbols = -export-symbols $(srcdir)/plugin.def
-
-plugin_deps = libclaws.a libmypgpcore.a $(plugin_res) plugin.def
+if OS_WIN32
 
 libclaws.a: claws.def
        $(DLLTOOL) --output-lib $@ --def $<
@@ -33,28 +23,21 @@ libclaws.a: claws.def
 libmypgpcore.a: mypgpcore.def
        $(DLLTOOL) --output-lib $@ --def $<
 
-plugin_ldadd = -L. -lclaws  -lmypgpcore
+%.lo : %.rc
+       $(LIBTOOL) --mode=compile --tag=RC $(RC) -i $< -o $@
 
-else
-plugin_res =
-plugin_res_ldflag =
-export_symbols =
-plugin_deps =
-plugin_ldadd =
-endif
+plugin_ldflags += \
+       -Wl,.libs/version.o \
+       -no-undefined \
+       -export-symbols $(srcdir)/plugin.def
+plugin_extra_deps += libclaws.a version.lo plugin.def libmypgpcore.a
+plugin_libadd += -L. -lclaws -lmypgpcore
 
-if PLATFORM_WIN32
-no_undefined = -no-undefined
-else
-no_undefined =
 endif
 
 if CYGWIN
-cygwin_export_lib = -L$(top_builddir)/src -lclaws-mail
-pgpcore_lib = ../pgpcore/pgpcore.la
-else
-cygwin_export_lib = 
-pgpcore_lib = 
+plugin_ldflags += -no-undefined
+plugin_libadd += -L$(top_builddir)/src -lclaws-mail ../pgpcore/pgpcore.la
 endif
 
 plugindir = $(pkglibdir)/plugins
@@ -64,16 +47,14 @@ if BUILD_PGPINLINE_PLUGIN
 plugin_LTLIBRARIES = pgpinline.la
 endif
 
-pgpinline_la_SOURCES = \
-       plugin.c \
-       pgpinline.c pgpinline.h
-
 pgpinline_la_LDFLAGS = \
-       $(plugin_res_ldflag) $(no_undefined) $(export_symbols) \
+       $(plugin_ldflags) \
        -avoid-version -module 
-pgpinline_la_DEPENDENCIES = $(plugin_deps)
-pgpinline_la_LIBADD = $(plugin_ldadd) $(pgpcore_lib) $(cygwin_export_lib) \
-        $(GTK_LIBS)  \
+
+EXTRA_pgpinline_la_DEPENDENCIES = $(plugin_extra_deps)
+
+pgpinline_la_LIBADD = $(plugin_libadd) \
+       $(GTK_LIBS)  \
        $(GPGME_LIBS)
 
 pgpinline_la_CPPFLAGS = \
@@ -83,7 +64,12 @@ pgpinline_la_CPPFLAGS = \
        $(GPGME_CFLAGS) \
        -Wno-deprecated-declarations
 
+pgpinline_la_SOURCES = \
+       pgpinline.c \
+       pgpinline.h \
+       plugin.c
+
 clean-local:
-       rm -f libclaws.a
+       rm -f libclaws.a libmypgpcore.a
 
 .PHONY: test