Minor edits of Template Wildcards table:
[geany-mirror.git] / plugins / Makefile.am
blob61974876df175be2f3b406832d7afda1f9939899
1 # Adapted from Pidgin's plugins/Makefile.am, thanks
3 EXTRA_DIST = \
4         makefile.win32 \
5         genapi.py
7 plugindir = $(libdir)/geany
9 plugins_includedir = $(includedir)/geany
10 plugins_include_HEADERS = \
11         geanyplugin.h \
12         geanyfunctions.h
14 # systems without python should continue to build OK
15 geanyfunctions.h: genapi.py ../src/plugins.c
16         python genapi.py || true
18 all: geanyfunctions.h
21 demoplugin_la_LDFLAGS    = -module -avoid-version
22 classbuilder_la_LDFLAGS  = -module -avoid-version
23 htmlchars_la_LDFLAGS     = -module -avoid-version
24 export_la_LDFLAGS        = -module -avoid-version
25 saveactions_la_LDFLAGS   = -module -avoid-version
26 filebrowser_la_LDFLAGS   = -module -avoid-version
27 splitwindow_la_LDFLAGS   = -module -avoid-version
29 if PLUGINS
31 if MINGW
32 # build Geany for Windows on non-Windows systems (cross-compile)
33 # (this is a little hack'ish and surely can be improved)
34 DLL_LD_FLAGS = -module -avoid-version
35 MINGW_CFLAGS = \
36                         -DGEANY_DATADIR=\"data\" \
37                         -DHAVE_CONFIG_H \
38                         -I$(top_srcdir) \
39                         -I$(top_srcdir)/src \
40                         -I$(top_srcdir)/tagmanager/include \
41                         -I$(top_srcdir)/scintilla/include \
42                         $(GTK_CFLAGS) \
43                         $(PLUGIN_CFLAGS)
45 .PHONY: all clean
47 all-local: \
48         classbuilder.dll \
49         htmlchars.dll \
50         export.dll \
51         saveactions.dll \
52         filebrowser.dll
53 # Split Window is broken on Windows
54 #       splitwindow.dll
56 .c.dll:
57         $(CC) $(MINGW_CFLAGS) -o $@.o -c $<
58         $(CC) -shared $@.o $(GTK_LIBS) $(DLL_LD_FLAGS) -o $@
60 clean:
61         rm -f *.o *.dll
63 else
65 # Plugins to be installed
66 plugin_LTLIBRARIES = \
67         classbuilder.la \
68         htmlchars.la \
69         export.la \
70         saveactions.la \
71         filebrowser.la \
72         splitwindow.la
74 # Plugins not to be installed
75 noinst_LTLIBRARIES = \
76         demoplugin.la
78 demoplugin_la_SOURCES    = demoplugin.c
79 classbuilder_la_SOURCES  = classbuilder.c
80 htmlchars_la_SOURCES     = htmlchars.c
81 export_la_SOURCES        = export.c
82 saveactions_la_SOURCES   = saveactions.c
83 filebrowser_la_SOURCES   = filebrowser.c
84 splitwindow_la_SOURCES   = splitwindow.c
86 # instead of linking against all in $(GTK_LIBS), we link only against needed libs
87 demoplugin_la_LIBADD    = $(GTK_LIBS)
88 classbuilder_la_LIBADD  = $(GTK_LIBS)
89 htmlchars_la_LIBADD     = $(GTK_LIBS)
90 export_la_LIBADD        = $(GTK_LIBS)
91 saveactions_la_LIBADD   = $(GTK_LIBS)
92 filebrowser_la_LIBADD   = $(GTK_LIBS)
93 splitwindow_la_LIBADD   = $(GTK_LIBS)
95 endif # MINGW
96 endif # PLUGINS
98 AM_CPPFLAGS = \
99         -DDATADIR=\"$(datadir)\" \
100         -I$(top_srcdir)/src \
101         -I$(top_srcdir)/tagmanager/include \
102         -I$(top_srcdir)/scintilla/include \
103         $(GTK_CFLAGS) \
104         $(PLUGIN_CFLAGS)
107 # This part allows people to build their own plugins in here.
108 # Yes, it's a mess.
110 SUFFIXES = .c .so
111 .c.so:
112         $(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H -I$(top_srcdir) $(AM_CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo $(PLUGIN_CFLAGS)
113         $(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) -module -avoid-version $(PLUGIN_LIBS)
114         @rm -f tmp$@.lo tmp$@.o libtmp$@.la
115         @cp .libs/libtmp$@.so* $@
116         @rm -f .libs/libtmp$@.*