2 # Gnumeric's Makefile.am
3 # Author: Miguel de Icaza (miguel@kernel.org)
4 -include $(INTROSPECTION_MAKEFILE)
6 INTROSPECTION_SCANNER_ARGS = \
7 --add-include-path="${INTROSPECTION_GIRDIR}" \
8 -v --warn-all --accept-unprefixed \
9 --identifier-prefix="Gnm" --identifier-prefix="Gnumeric" \
11 -DGOFFICE_NAMESPACE_DISABLE
12 INTROSPECTION_COMPILER_ARGS = \
13 --includedir=$(srcdir) \
15 --includedir="${INTROSPECTION_GIRDIR}"
17 SUBDIRS = tools cut-n-paste-code
19 lib_LTLIBRARIES = libspreadsheet.la
23 noinst_PROGRAMS = sstest
25 noinst_HEADERS = dead-kittens.h compilation.h gnm-i18n.h
28 SUBDIRS += dialogs widgets
29 bin_PROGRAMS += gnumeric
30 check_PROGRAMS += test-pango
33 bin_PROGRAMS += ssconvert ssindex ssgrep ssdiff
43 # A hint is needed to build these headers first:
51 # Another hint, see bugs #172211 and #172212:
52 non-intermediate: gnm-marshalers.c gnmresources.c
54 resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir) --generate-dependencies $(srcdir)/gnm.gresource.xml)
56 gnmresources.h: gnm.gresource.xml
57 $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
58 --target=$@ --sourcedir=$(top_srcdir) --c-name _gnm --generate-header --manual-register
59 gnmresources.c: gnm.gresource.xml $(resource_files) Makefile
60 $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
61 --target=$@ --sourcedir=$(top_srcdir) --c-name _gnm --generate-source --manual-register
64 CLEANFILES = $(BUILT_SOURCES) \
67 libspreadsheet_la_CPPFLAGS = $(AM_CPPFLAGS) -DGNUMERIC_INTERNAL
68 libspreadsheet_la_LDFLAGS = -release $(VERSION)
69 libspreadsheet_la_LIBADD = \
70 $(gnumeric_app_libs) \
74 libspreadsheet_la_SOURCES = \
79 go-data-cache-source.c \
80 go-data-cache-source.h \
81 go-data-cache-impl.h \
84 go-data-cache-field-impl.h \
85 go-data-cache-field.h \
86 go-data-cache-field.c \
87 go-data-slicer-impl.h \
90 go-data-slicer-field-impl.h \
91 go-data-slicer-field.h \
92 go-data-slicer-field.c \
94 gnm-data-cache-source.h \
95 gnm-data-cache-source.c \
98 gnm-sheet-slicer-combo.h \
99 gnm-sheet-slicer-combo.c \
116 command-context-stderr.c \
130 gnm-commands-slicer.c \
137 gnumeric-simple-canvas.c \
160 preview-grid-impl.h \
163 rangefunc-strings.c \
176 sheet-control-gui.c \
182 sheet-object-cell-comment.c \
187 sheet-object-component.c \
188 sheet-object-graph.c \
189 sheet-object-image.c \
190 sheet-object-widget.c \
206 workbook-cmd-format.c \
218 nodist_libspreadsheet_la_SOURCES = gnmresources.c gnmresources.h
220 # When we switch to subversion fix this to nest as
221 # libspreadsheet-ver/spreadsheet/header
222 # doing it now would require massive cvs surgery.
223 libspreadsheet_includedir = $(includedir)/libspreadsheet-@GNUMERIC_API_VER@/spreadsheet
224 libspreadsheet_include_HEADERS = \
235 command-context-stderr.h \
252 gnm-commands-slicer.h \
253 gnm-data-cache-source.h \
263 gnumeric-simple-canvas.h \
264 go-data-cache-source.h \
266 go-data-cache-field.h \
268 go-data-slicer-field.h \
294 rangefunc-strings.h \
308 sheet-control-priv.h \
309 sheet-control-gui.h \
310 sheet-control-gui-priv.h \
316 sheet-filter-combo.h \
318 sheet-object-impl.h \
319 sheet-object-cell-comment.h \
320 sheet-object-widget-impl.h \
325 sheet-object-component.h \
326 sheet-object-graph.h \
327 sheet-object-image.h \
328 sheet-object-widget.h \
346 workbook-cmd-format.h \
349 workbook-control-priv.h \
367 gnumeric_LDFLAGS = -export-dynamic
369 ssconvert_LDADD = $(gnumeric_LDADD)
370 ssconvert_LDFLAGS = -export-dynamic
371 ssconvert_SOURCES = \
373 ssindex_LDADD = $(gnumeric_LDADD)
374 ssindex_LDFLAGS = -export-dynamic
377 ssgrep_LDADD = $(gnumeric_LDADD)
378 ssgrep_LDFLAGS = -export-dynamic
381 sstest_LDADD = $(gnumeric_LDADD)
382 sstest_LDFLAGS = -export-dynamic
385 ssdiff_LDADD = $(gnumeric_LDADD)
386 ssdiff_LDFLAGS = -export-dynamic
390 test_pango_LDADD = $(gnumeric_LDADD)
391 test_pango_LDFLAGS = -export-dynamic
392 test_pango_SOURCES = \
396 gnumeric_LDADD += gnumeric_rc.o
397 gnumeric_LDFLAGS += -mwindows -Wl,--stack,0x4000000
398 ssconvert_LDFLAGS += -mconsole -Wl,--stack,0x4000000
399 ssindex_LDFLAGS += -mconsole
400 ssgrep_LDFLAGS += -mconsole
402 libspreadsheet_la_DEPENDENCIES = libspreadsheet.def
403 libspreadsheet_la_LDFLAGS += -no-undefined -export-symbols libspreadsheet.def
407 libspreadsheet.def: local.def
408 echo EXPORTS > $@ && \
411 local.def: stamp-local.def
414 stamp-local.def: $(libspreadsheet_include_HEADERS) Makefile $(top_srcdir)/tools/dumpdef.pl
415 hdrs='$(libspreadsheet_include_HEADERS) dialogs/dialogs.h dialogs/tool-dialogs.h tools/dao.h tools/goal-seek.h tools/analysis-tools.h tools/gnm-solver.h widgets/gnumeric-expr-entry.h'; \
417 for hdr in $$hdrs; do \
418 if test -f $(srcdir)/$$hdr; then \
419 hdrs_list="$$hdrs_list $(srcdir)/$$hdr"; \
421 hdrs_list="$$hdrs_list $$hdr"; \
424 cat $(top_builddir)/gnumeric-config.h $$hdrs_list | \
425 sed -e 's/^#[ \t]*include[ \t]\+.*$$//g' | \
426 $(CPP) $(AM_CPPFLAGS) "-DGNM_VAR_DECL=__declspec(dllexport)" -P - > xgen-localdef.1 && \
427 perl $(top_srcdir)/tools/dumpdef.pl \
428 xgen-localdef.1 > xgen-localdef.2 \
429 && (cmp -s xgen-localdef.2 local.def || \
430 cp xgen-localdef.2 local.def) \
431 && rm -f xgen-localdef.1 xgen-localdef.2 \
432 && echo timestamp > $@
436 gnumeric_app_libs = \
437 dialogs/libdialogs.la \
439 widgets/libwidgets.la
442 # Rules for the marshalers code:
443 GENMARSHAL_COMMAND = $(GLIB_GENMARSHAL) --prefix=gnm_
446 $(GENMARSHAL_COMMAND) --header $< >$@
449 (echo '/* This file has been automatically generated. Do not edit. */' && \
450 echo '#include "$*.h"' && \
451 $(GENMARSHAL_COMMAND) --body $< ) >$@
453 # Depends on this Makefile, because it uses make variables.
454 gnumeric-paths.h: Makefile
457 echo '/* This file has been automatically generated. Do not edit. */'; \
459 echo '#ifndef GNUMERIC_PATHS_H'; \
460 echo '#define GNUMERIC_PATHS_H'; \
462 echo '#define GNUMERIC_PREFIX "$(prefix)"'; \
463 echo '#define GNUMERIC_SYSCONFDIR "$(sysconfdir)"'; \
464 echo '#define GNUMERIC_DATADIR "$(gnumeric_datadir)"'; \
465 echo '#define GNUMERIC_LIBDIR "$(gnumeric_libdir)"'; \
466 echo '#define GNUMERIC_ICONDIR "$(gnumeric_icondir)"'; \
467 echo '#define GNUMERIC_LOCALEDIR "$(gnumeric_localedir)"'; \
468 echo '#define GNUMERIC_EXTERNPLUGINDIR "$(gnumeric_externplugindir)"'; \
470 echo '#endif /* GNUMERIC_PATHS_H */'; \
473 update-gnumeric-conf:
474 make -C ${top_srcdir}/schemas
475 rm -f gnumeric-conf.c.tmp
476 @PERL@ -pe 'if (/AUTOMATICALLY GENERATED CODE BELOW/) { print; print "\n"; last; }' <gnumeric-conf.c >gnumeric-conf.c.tmp
477 @PERL@ ${top_srcdir}/tools/handle-conf-options --cfile ${top_srcdir}/schemas/org.gnome.gnumeric*.gschema.xml.in >>gnumeric-conf.c.tmp
478 if cmp gnumeric-conf.c gnumeric-conf.c.tmp; then \
479 rm gnumeric-conf.c.tmp; \
481 mv gnumeric-conf.c.tmp gnumeric-conf.c; \
483 rm -f gnumeric-conf.h.tmp
484 @PERL@ -pe 'if (/AUTOMATICALLY GENERATED CODE BELOW/) { print; print "\n"; last; }' <gnumeric-conf.h >gnumeric-conf.h.tmp
485 @PERL@ ${top_srcdir}/tools/handle-conf-options --hfile ${top_srcdir}/schemas/org.gnome.gnumeric*.gschema.xml.in >>gnumeric-conf.h.tmp
486 echo '' >>gnumeric-conf.h.tmp
487 @PERL@ -ne '$$p=1 if (/AUTOMATICALLY GENERATED CODE ABOVE/); print if $$p;' <gnumeric-conf.h >>gnumeric-conf.h.tmp
488 if cmp gnumeric-conf.h gnumeric-conf.h.tmp; then \
489 rm gnumeric-conf.h.tmp; \
491 mv gnumeric-conf.h.tmp gnumeric-conf.h; \
495 gnumeric_rc.o: gnumeric.rc ../gnumeric-config.h
496 $(WINDRES) -DVERSION=$(VERSION) -DVERSION_NUMBER=`echo $(VERSION).0.0.0 | sed 's/\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\).*/\1,\2,\3,\4/'` --include-dir $(srcdir) -i $< -o $@
500 cd $(DESTDIR)$(bindir) && \
501 mv -f gnumeric$(EXEEXT) gnumeric-$(VERSION)$(EXEEXT) && \
502 $(LN_S) gnumeric-$(VERSION)$(EXEEXT) gnumeric$(EXEEXT)
506 -cd $(DESTDIR)$(bindir) && \
507 rm -f gnumeric-$(VERSION)$(EXEEXT)
509 # include conditional files to ensure everything gets distributed no matter
513 pixmaps/line_pattern_dash_dot.png \
514 pixmaps/line_pattern_dash_dot_dot.png \
515 pixmaps/line_pattern_dashed.png \
516 pixmaps/line_pattern_dotted.png \
517 pixmaps/line_pattern_double.png \
518 pixmaps/line_pattern_hair.png \
519 pixmaps/line_pattern_medium.png \
520 pixmaps/line_pattern_medium_dash.png \
521 pixmaps/line_pattern_medium_dash_dot.png \
522 pixmaps/line_pattern_medium_dash_dot_dot.png \
523 pixmaps/line_pattern_slant.png \
524 pixmaps/line_pattern_thick.png \
525 pixmaps/line_pattern_thin.png \
526 pixmaps/right-down.png \
527 pixmaps/down-right.png \
528 pixmaps/gnumeric_splash_1.4.png \
529 pixmaps/unknown_image.png \
530 pixmaps/sheet_move_marker.png \
532 gnm-marshalers.list \
535 GNOME_Gnumeric-gtk.xml.in
537 gtkactiondir=$(gnumeric_datadir)
539 gtkaction_DATA = GNOME_Gnumeric-gtk.xml
540 GNOME_Gnumeric-gtk.xml: GNOME_Gnumeric-gtk.xml.in
541 sed -e 's/ _name *=/ name=/' <$< >$@
542 DISTCLEANFILES = GNOME_Gnumeric-gtk.xml
544 if HAVE_INTROSPECTION
546 INTROSPECTION_GIRS += Gnm-@GNUMERIC_API_VER@.gir
548 Gnm-@GNUMERIC_API_VER@.gir: $(INTROSPECTION_SCANNER) libspreadsheet.la Makefile
549 Gnm_@GNUMERIC_API_VER_@_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0 \
550 Gsf-1 GOffice-@GOFFICE_API_VER@
551 Gnm_@GNUMERIC_API_VER_@_gir_CFLAGS = $(AM_CPPFLAGS)
552 Gnm_@GNUMERIC_API_VER_@_gir_LIBS = libspreadsheet.la
553 Gnm_@GNUMERIC_API_VER_@_gir_FILES = \
554 $(libspreadsheet_la_SOURCES) \
555 $(libspreadsheet_include_HEADERS) \
561 widgets/gnumeric-expr-entry.c \
562 widgets/gnumeric-expr-entry.h
566 gir_DATA = $(INTROSPECTION_GIRS)
568 typelibsdir = $(TYPELIBDIR)
569 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
571 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
573 endif # HAVE_INTROSPECTION