Update plugin makefiles for Windows
authorJonathan Boeing <jonathan@claws-mail.org>
Mon, 20 Sep 2021 10:18:44 +0000 (03:18 -0700)
committerJonathan Boeing <jonathan@claws-mail.org>
Mon, 20 Sep 2021 10:18:44 +0000 (03:18 -0700)
src/plugins/pdf_viewer/Makefile.am

index 54688d8495f106bf3b06d3090df7b8e29e177690..a20918f287f9fc0d2bfe930313fe428f0127d5d1 100644 (file)
@@ -3,51 +3,39 @@
 # terms of the General Public License version 3 (or later).
 # See COPYING file for license details.
 
-EXTRA_DIST = claws.def plugin.def version.rc
+EXTRA_DIST = claws.def plugin.def
 
 IFLAGS = \
        -I$(top_builddir)/src \
+       -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
-
-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_ldflags =
+plugin_extra_deps =
+plugin_libadd =
 
-plugin_res = version.lo
-plugin_res_ldflag = -Wl,.libs/version.o
-export_symbols = -export-symbols $(srcdir)/plugin.def
-plugin_deps = libclaws.a $(plugin_res) plugin.def
-plugin_ldadd = -L. -lclaws
+if OS_WIN32
 
 libclaws.a: claws.def
        $(DLLTOOL) --output-lib $@ --def $<
 
-else
-plugin_res =
-plugin_res_ldflag =
-export_symbols =
-plugin_deps =
-plugin_ldadd =
-endif
+%.lo : %.rc
+       $(LIBTOOL) --mode=compile --tag=RC $(RC) -i $< -o $@
+
+plugin_ldflags += \
+       -Wl,.libs/version.o \
+       -no-undefined \
+       -export-symbols $(srcdir)/plugin.def
+plugin_extra_deps += libclaws.a version.lo plugin.def
+plugin_libadd += -L. -lclaws
 
-if PLATFORM_WIN32
-no_undefined = -no-undefined
-else
-no_undefined =
 endif
 
 if CYGWIN
-cygwin_export_lib = -L$(top_builddir)/src -lclaws-mail
-else
-cygwin_export_lib =
+plugin_ldflags += -no-undefined
+plugin_libadd += -L$(top_builddir)/src -lclaws-mail
 endif
 
 plugindir = $(pkglibdir)/plugins
@@ -56,17 +44,13 @@ if BUILD_PDF_VIEWER_PLUGIN
 plugin_LTLIBRARIES = pdf_viewer.la
 endif
 
-pdf_viewer_la_SOURCES = \
-       poppler_viewer.c \
-       poppler_viewer.h
-
 pdf_viewer_la_LDFLAGS = \
-       $(plugin_res_ldflag) $(no_undefined) $(export_symbols) \
+       $(plugin_ldflags) \
        -avoid-version -module
 
-pdf_viewer_la_DEPENDENCIES = $(plugin_deps)
+EXTRA_pdf_viewer_la_DEPENDENCIES = $(plugin_extra_deps)
 
-pdf_viewer_la_LIBADD = $(plugin_ldadd) $(cygwin_export_lib) \
+pdf_viewer_la_LIBADD = $(plugin_libadd) \
        $(GTK_LIBS) \
        $(POPPLER_LIBS)
 
@@ -77,4 +61,11 @@ pdf_viewer_la_CPPFLAGS = \
        $(ENCHANT_CFLAGS) \
        $(POPPLER_CFLAGS)
 
+pdf_viewer_la_SOURCES = \
+       poppler_viewer.c \
+       poppler_viewer.h
+
+clean-local:
+       rm -f libclaws.a
+
 .PHONY: test