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