Remove makefile.win32 based build system
[geany-mirror.git] / src / Makefile.am
blob9454c44772e89c161e8a0f4a99a8871fae37bc8f
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$(srcdir)/tagmanager \
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         $(builddir)/tagmanager/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_LOCALEDIR=\"\" \
142         -DGEANY_PREFIX=\"\"
144 geany_LDADD += geany_private.res
146 WINDRES = $(host_alias)-windres
148 geany_private.res: $(top_srcdir)/geany_private.rc
149         $(WINDRES) -i $(top_srcdir)/geany_private.rc --input-format=rc -o $@ -O coff
151 libgeany_la_SOURCES += win32.c win32.h
152 libgeany_la_LIBADD  += -lole32 -lwsock32 -lcomdlg32
153 libgeany_la_LDFLAGS += -Wl,-luuid -mwindows -mms-bitfields -no-undefined
154 geany_LDFLAGS       += -mwindows -mms-bitfields
156 CLEANFILES          += geany_private.res
158 else
159 # build Geany for all other platforms
161 AM_CPPFLAGS += \
162         -DGEANY_DATADIR=\""$(datadir)"\" \
163         -DGEANY_DOCDIR=\""$(docdir)"\" \
164         -DGEANY_LIBDIR=\""$(libdir)"\" \
165         -DGEANY_LOCALEDIR=\""$(localedir)"\" \
166         -DGEANY_PREFIX=\""$(prefix)"\"
168 libgeany_la_SOURCES += vte.c vte.h
170 endif
172 callbacks.c: signallist.i
174 glade_file=$(top_srcdir)/data/geany.glade
176 signallist.i: $(glade_file) Makefile
177         $(AM_V_GEN)( \
178                 echo '/* This file is auto-generated, do not edit. */' && \
179                 $(SED) -n 's/^.*handler="\([^"]\{1,\}\)".*$$/ITEM(\1)/p' "$(glade_file)" \
180                         | $(SORT) | $(UNIQ) \
181         ) > $@ || { $(RM) $@ && exit 1; }
183 CLEANFILES += signallist.i
185 # Ubuntu ld has a bug so that libtool sees /usr/local/lib as a system path so
186 # doesn't add RPATH, but ld requires explicit ldconfig there, unlike when
187 # installing in /usr/lib.  So, workaround this by calling it explicitly when
188 # installing in /usr/local/lib and libgeany is not found by the linker.
189 fix-ubuntu-libdir:
190         if test "$(DESTDIR)$(libdir)" = /usr/local/lib && \
191            LANG=C ldd "$(DESTDIR)$(bindir)/geany" | grep -q 'libgeany.*not found' \
192         ; then \
193                 ldconfig "$(DESTDIR)$(libdir)"; \
194         fi
196 install-exec-hook: fix-ubuntu-libdir