Merge pull request #475 from techee/retval_refresh
[geany-mirror.git] / plugins / Makefile.am
blob71603e67fc5df7cbd8346e7523a8d4db53332704
1 # Adapted from Pidgin's plugins/Makefile.am, thanks
3 EXTRA_DIST = \
4         makefile.win32
6 if MINGW
7 plugindir = $(libdir)
8 else
9 plugindir = $(libdir)/geany
10 endif
12 plugins_includedir = $(includedir)/geany
13 plugins_include_HEADERS = \
14         geanyfunctions.h \
15         geanyplugin.h
17 demoplugin_la_LDFLAGS    = -module -avoid-version -no-undefined
18 classbuilder_la_LDFLAGS  = -module -avoid-version -no-undefined
19 htmlchars_la_LDFLAGS     = -module -avoid-version -no-undefined
20 export_la_LDFLAGS        = -module -avoid-version -no-undefined
21 saveactions_la_LDFLAGS   = -module -avoid-version -no-undefined
22 filebrowser_la_LDFLAGS   = -module -avoid-version -no-undefined
23 splitwindow_la_LDFLAGS   = -module -avoid-version -no-undefined
25 if PLUGINS
26 # Plugins to be installed
27 plugin_LTLIBRARIES = \
28         classbuilder.la \
29         htmlchars.la \
30         export.la \
31         saveactions.la \
32         filebrowser.la \
33         splitwindow.la
35 # Plugins not to be installed
36 noinst_LTLIBRARIES = \
37         demoplugin.la
39 demoplugin_la_SOURCES    = demoplugin.c
40 classbuilder_la_SOURCES  = classbuilder.c
41 htmlchars_la_SOURCES     = htmlchars.c
42 export_la_SOURCES        = export.c
43 saveactions_la_SOURCES   = saveactions.c
44 filebrowser_la_SOURCES   = filebrowser.c
45 splitwindow_la_SOURCES   = splitwindow.c
47 demoplugin_la_CFLAGS    = -DG_LOG_DOMAIN=\""Demoplugin"\"
48 classbuilder_la_CFLAGS  = -DG_LOG_DOMAIN=\""Classbuilder"\"
49 htmlchars_la_CFLAGS     = -DG_LOG_DOMAIN=\""HTMLChars"\"
50 export_la_CFLAGS        = -DG_LOG_DOMAIN=\""Export"\"
51 saveactions_la_CFLAGS   = -DG_LOG_DOMAIN=\""SaveActions"\"
52 filebrowser_la_CFLAGS   = -DG_LOG_DOMAIN=\""FileBrowser"\"
53 splitwindow_la_CFLAGS   = -DG_LOG_DOMAIN=\""SplitWindow"\"
55 demoplugin_la_LIBADD    = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
56 classbuilder_la_LIBADD  = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
57 htmlchars_la_LIBADD     = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
58 export_la_LIBADD        = $(top_builddir)/src/libgeany.la $(GTK_LIBS) -lm
59 saveactions_la_LIBADD   = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
60 filebrowser_la_LIBADD   = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
61 splitwindow_la_LIBADD   = $(top_builddir)/src/libgeany.la $(GTK_LIBS)
63 endif # PLUGINS
65 if MINGW
66 # FIXME: why is this define different than the non-MINGW one?
67 AM_CPPFLAGS = -DGEANY_DATADIR=\"data\"
68 else
69 AM_CPPFLAGS = -DDATADIR=\"$(datadir)\"
70 endif
72 AM_CPPFLAGS += \
73         -DGTK \
74         -I$(top_srcdir)/src \
75         -I$(top_srcdir)/tagmanager/src \
76         -I$(top_srcdir)/scintilla/include \
77         $(GTK_CFLAGS) \
78         $(PLUGIN_CFLAGS)
81 # This part allows people to build their own plugins in here.
82 # Yes, it's a mess.
84 custom_plugins_cppflags = -DHAVE_CONFIG_H -I$(top_srcdir)
85 custom_plugins_ldflags = -module -avoid-version
86 if MINGW
87 SUFFIXES = .c .dll
88 .c.dll:
89         $(CC) $(AM_CPPFLAGS) $(custom_plugins_cppflags) $(CPPFLAGS) $(CFLAGS) -o $@.o -c $<
90         $(CC) -shared $@.o $(GTK_LIBS) $(custom_plugins_ldflags) $(LIBS) $(PLUGIN_LIBS) $(LDFLAGS) -o $@
91 else
92 SUFFIXES = .c .so
93 .c.so:
94         $(LIBTOOL) --mode=compile $(CC) $(AM_CPPFLAGS) $(custom_plugins_cppflags) $(CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo
95         $(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) $(custom_plugins_ldflags) $(PLUGIN_LIBS)
96         @rm -f tmp$@.lo tmp$@.o libtmp$@.la
97         @cp .libs/libtmp$@.so* $@
98         @rm -f .libs/libtmp$@.*
99 endif