r5085
[geany-mirror.git] / plugins / Makefile.am
blob9c5b48834969353eebf1e694aceb29f21544777c
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                         -DGTK \
39                         -I$(top_srcdir) \
40                         -I$(top_srcdir)/src \
41                         -I$(top_srcdir)/tagmanager/include \
42                         -I$(top_srcdir)/scintilla/include \
43                         $(GTK_CFLAGS) \
44                         $(PLUGIN_CFLAGS)
46 .PHONY: all clean
48 all-local: \
49         classbuilder.dll \
50         htmlchars.dll \
51         export.dll \
52         saveactions.dll \
53         filebrowser.dll
54 # Split Window is broken on Windows
55 #       splitwindow.dll
57 .c.dll:
58         $(CC) $(MINGW_CFLAGS) -o $@.o -c $<
59         $(CC) -shared $@.o $(GTK_LIBS) $(DLL_LD_FLAGS) -o $@
61 clean:
62         rm -f *.o *.dll
64 else
66 # Plugins to be installed
67 plugin_LTLIBRARIES = \
68         classbuilder.la \
69         htmlchars.la \
70         export.la \
71         saveactions.la \
72         filebrowser.la \
73         splitwindow.la
75 # Plugins not to be installed
76 noinst_LTLIBRARIES = \
77         demoplugin.la
79 demoplugin_la_SOURCES    = demoplugin.c
80 classbuilder_la_SOURCES  = classbuilder.c
81 htmlchars_la_SOURCES     = htmlchars.c
82 export_la_SOURCES        = export.c
83 saveactions_la_SOURCES   = saveactions.c
84 filebrowser_la_SOURCES   = filebrowser.c
85 splitwindow_la_SOURCES   = splitwindow.c
87 demoplugin_la_CFLAGS    = -DG_LOG_DOMAIN=\""Demoplugin"\"
88 classbuilder_la_CFLAGS  = -DG_LOG_DOMAIN=\""Classbuilder"\"
89 htmlchars_la_CFLAGS     = -DG_LOG_DOMAIN=\""HTMLChars"\"
90 export_la_CFLAGS        = -DG_LOG_DOMAIN=\""Export"\"
91 saveactions_la_CFLAGS   = -DG_LOG_DOMAIN=\""SaveActions"\"
92 filebrowser_la_CFLAGS   = -DG_LOG_DOMAIN=\""FileBrowser"\"
93 splitwindow_la_CFLAGS   = -DG_LOG_DOMAIN=\""SplitWindow"\"
95 demoplugin_la_LIBADD    = $(GTK_LIBS)
96 classbuilder_la_LIBADD  = $(GTK_LIBS)
97 htmlchars_la_LIBADD     = $(GTK_LIBS)
98 export_la_LIBADD        = $(GTK_LIBS)
99 saveactions_la_LIBADD   = $(GTK_LIBS)
100 filebrowser_la_LIBADD   = $(GTK_LIBS)
101 splitwindow_la_LIBADD   = $(GTK_LIBS)
103 endif # MINGW
104 endif # PLUGINS
106 AM_CPPFLAGS = \
107         -DDATADIR=\"$(datadir)\" \
108         -DGTK \
109         -I$(top_srcdir)/src \
110         -I$(top_srcdir)/tagmanager/include \
111         -I$(top_srcdir)/scintilla/include \
112         $(GTK_CFLAGS) \
113         $(PLUGIN_CFLAGS)
116 # This part allows people to build their own plugins in here.
117 # Yes, it's a mess.
119 SUFFIXES = .c .so
120 .c.so:
121         $(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H -I$(top_srcdir) $(AM_CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo $(PLUGIN_CFLAGS)
122         $(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) -module -avoid-version $(PLUGIN_LIBS)
123         @rm -f tmp$@.lo tmp$@.o libtmp$@.la
124         @cp .libs/libtmp$@.so* $@
125         @rm -f .libs/libtmp$@.*