Use a program run helper rather than a script
[geany-mirror.git] / src / Makefile.am
blobfd5dc55a118ef3f290a6d9c398a032948175b7e7
1 ## Process this file with automake to produce Makefile.in
4 EXTRA_DIST = \
5         gb.c \
6         plugindata.h \
7         documentprivate.h \
8         encodingsprivate.h \
9         filetypesprivate.h \
10         keybindingsprivate.h \
11         pluginprivate.h \
12         projectprivate.h \
13         makefile.win32
15 AM_CPPFLAGS = \
16         -I$(top_srcdir) \
17         -I$(top_srcdir)/scintilla/include \
18         -I$(top_srcdir)/tagmanager/src \
19         -DGTK \
20         -DGEANY_PRIVATE \
21         -DG_LOG_DOMAIN=\""Geany"\" \
22         @GTK_CFLAGS@ @GTHREAD_CFLAGS@ \
23         $(MAC_INTEGRATION_CFLAGS)
25 bin_PROGRAMS = geany
26 lib_LTLIBRARIES = libgeany.la
28 geany_SOURCES = main.c
29 geany_LDADD = libgeany.la $(GTK_LIBS) $(GTHREAD_LIBS) $(INTLLIBS)
30 geany_LDFLAGS =
32 if ENABLE_BINRELOC
33 geany_LDFLAGS += -Wl,-rpath='$$ORIGIN/../lib'
34 endif
36 geany_includedir = $(includedir)/geany
37 geany_include_HEADERS = \
38         app.h \
39         build.h \
40         dialogs.h \
41         document.h \
42         editor.h \
43         encodings.h \
44         filetypes.h \
45         geany.h \
46         gtkcompat.h \
47         highlighting.h \
48         keybindings.h \
49         main.h \
50         msgwindow.h \
51         navqueue.h \
52         plugindata.h \
53         pluginutils.h \
54         prefs.h \
55         project.h \
56         sciwrappers.h \
57         search.h \
58         spawn.h \
59         stash.h \
60         support.h \
61         symbols.h \
62         templates.h \
63         toolbar.h \
64         ui_utils.h \
65         utils.h
67 libgeany_la_SOURCES = \
68         about.c about.h \
69         app.h \
70         build.c build.h \
71         callbacks.c callbacks.h \
72         dialogs.c dialogs.h \
73         document.c document.h \
74         editor.c editor.h \
75         encodings.c encodings.h \
76         filetypes.c filetypes.h \
77         geanyentryaction.c geanyentryaction.h \
78         geanymenubuttonaction.c geanymenubuttonaction.h \
79         geanyobject.c geanyobject.h \
80         geanywraplabel.c geanywraplabel.h \
81         gtkcompat.h \
82         highlighting.c highlighting.h \
83         highlightingmappings.h \
84         keybindings.c keybindings.h \
85         keyfile.c keyfile.h \
86         log.c log.h \
87         libmain.c main.h geany.h \
88         msgwindow.c msgwindow.h \
89         navqueue.c navqueue.h \
90         notebook.c notebook.h \
91         plugins.c plugins.h \
92         pluginutils.c pluginutils.h \
93         prefs.c prefs.h \
94         printing.c printing.h \
95         project.c project.h \
96         sciwrappers.c sciwrappers.h \
97         search.c search.h \
98         socket.c socket.h \
99         spawn.c spawn.h \
100         stash.c stash.h \
101         support.h \
102         symbols.c symbols.h \
103         templates.c templates.h \
104         toolbar.c toolbar.h \
105         tools.c tools.h \
106         sidebar.c sidebar.h \
107         ui_utils.c ui_utils.h \
108         utils.c utils.h
110 if ENABLE_BINRELOC
111 libgeany_la_SOURCES += prefix.c prefix.h
112 endif
114 if ENABLE_MAC_INTEGRATION
115 libgeany_la_SOURCES += osx.c osx.h
116 endif
118 libgeany_la_CFLAGS  = $(AM_CPPFLAGS) @LIBGEANY_CFLAGS@
119 libgeany_la_LDFLAGS = @LIBGEANY_LDFLAGS@
121 libgeany_la_LIBADD = \
122         $(top_builddir)/scintilla/libscintilla.la \
123         $(top_builddir)/tagmanager/src/libtagmanager.la \
124         @GTK_LIBS@ \
125         @GTHREAD_LIBS@ \
126         $(MAC_INTEGRATION_LIBS) \
127         $(INTLLIBS)
129 # tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
130 nodist_EXTRA_libgeany_la_SOURCES = dummy1.cxx
132 CLEANFILES =
134 if MINGW
135 # build Geany for Windows (possibly on non-Windows systems -- cross-compile)
137 AM_CPPFLAGS += \
138         -DGEANY_DATADIR=\"data\" \
139         -DGEANY_DOCDIR=\"\" \
140         -DGEANY_LIBDIR=\"\" \
141         -DGEANY_LIBEXECDIR=\"\" \
142         -DGEANY_LOCALEDIR=\"\" \
143         -DGEANY_PREFIX=\"\"
145 geany_LDADD += geany_private.res
147 WINDRES = $(host_alias)-windres
149 geany_private.res: $(top_srcdir)/geany_private.rc
150         $(WINDRES) -i $(top_srcdir)/geany_private.rc --input-format=rc -o $@ -O coff
152 libgeany_la_SOURCES += win32.c win32.h
153 libgeany_la_LIBADD  += -lole32 -lwsock32 -lcomdlg32
154 libgeany_la_LDFLAGS += -Wl,-luuid -mwindows -mms-bitfields -no-undefined
155 geany_LDFLAGS       += -mwindows -mms-bitfields
157 CLEANFILES          += geany_private.res
159 else
160 # build Geany for all other platforms
162 AM_CPPFLAGS += \
163         -DGEANY_DATADIR=\""$(datadir)"\" \
164         -DGEANY_DOCDIR=\""$(docdir)"\" \
165         -DGEANY_LIBDIR=\""$(libdir)"\" \
166         -DGEANY_LIBEXECDIR=\""$(libexecdir)"\" \
167         -DGEANY_LOCALEDIR=\""$(localedir)"\" \
168         -DGEANY_PREFIX=\""$(prefix)"\"
170 libgeany_la_SOURCES += vte.c vte.h
172 endif
174 callbacks.c: signallist.i
176 glade_file=$(top_srcdir)/data/geany.glade
178 signallist.i: $(glade_file) Makefile
179         $(AM_V_GEN)( \
180                 echo '/* This file is auto-generated, do not edit. */' && \
181                 $(SED) -n 's/^.*handler="\([^"]\{1,\}\)".*$$/ITEM(\1)/p' "$(glade_file)" \
182                         | $(SORT) | $(UNIQ) \
183         ) > $@ || { $(RM) $@ && exit 1; }
185 CLEANFILES += signallist.i
187 pkglibexec_PROGRAMS = geany-run-helper
188 geany_run_helper_SOURCES = geany-run-helper.c
189 geany_run_helper_CFLAGS = $(GTK_CFLAGS)
190 geany_run_helper_LDADD = $(GTK_LIBS)
192 # Ubuntu ld has a bug so that libtool sees /usr/local/lib as a system path so
193 # doesn't add RPATH, but ld requires explicit ldconfig there, unlike when
194 # installing in /usr/lib.  So, workaround this by calling it explicitly when
195 # installing in /usr/local/lib and libgeany is not found by the linker.
196 fix-ubuntu-libdir:
197         if test "$(DESTDIR)$(libdir)" = /usr/local/lib && \
198            LANG=C ldd "$(DESTDIR)$(bindir)/geany" | grep -q 'libgeany.*not found' \
199         ; then \
200                 ldconfig "$(DESTDIR)$(libdir)"; \
201         fi
203 install-exec-hook: fix-ubuntu-libdir