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