Add:Various:Adding LZMA support to binfiles
[navit-package] / navit / Makefile.am
1 include $(top_srcdir)/Makefile.inc
2 DIST_SUBDIRS=binding map fib-1.1 font fonts gui graphics osd speech support vehicle xpm maps
3 SUBDIRS=binding map fib-1.1 font gui graphics osd speech support vehicle xpm
4 if BUILD_SAMPLEMAP
5   SUBDIRS += maps
6 endif
7
8 if FONTS
9   SUBDIRS += fonts
10 endif
11
12 AM_CPPFLAGS = -I$(top_srcdir)/navit/lzma -I$(top_srcdir)/navit/fib-1.1 @NAVIT_CFLAGS@ @ZLIB_CFLAGS@ -DPREFIX=\"@prefix@\" -DLIBDIR=\"@libdir@\" -DMODULE=navit
13 BUILT_SOURCES = version.h navit_config.h
14 if BUILD_SAMPLEMAP
15   BUILT_SOURCES += osm2navit$(EXEEXT)
16 endif
17
18 bin_PROGRAMS = navit osm2navit
19
20 pkgdata_DATA = navit.xml
21
22 EXTRA_DIST = navit.xml 
23
24 noinst_LTLIBRARIES        = libnavit.la
25 libnavit_la_SOURCES = announcement.c atom.c attr.c cache.c callback.c command.c compass.c coord.c country.c cursor.c data_window.c debug.c \
26         event.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c lzma/LzmaDec.c lzma/LzmaEnc.c lzma/LzFind.c main.c map.c \
27         mapset.c maptype.c menu.c messages.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
28         profile.c projection.c roadprofile.c route.c search.c speech.c transform.c track.c \
29         util.c vehicle.c vehicleprofile.c xmlconfig.c announcement.h atom.h attr.h attr_def.h cache.h callback.h color.h command.h compass.h coord.h country.h \
30         cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
31         file.h graphics.h gtkext.h gui.h item.h item_def.h keys.h log.h layer.h layout.h main.h map-share.h map.h\
32         map_data.h mapset.h maptype.h menu.h messages.h navigation.h navit.h osd.h \
33         param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h roadprofile.h search.h speech.h \
34         transform.h track.h util.h vehicle.h vehicleprofile.h window.h xmlconfig.h zipfile.h \
35         navit_nls.h
36
37 navit_SOURCES = start.c
38 navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @INTLLIBS@ -Lfib-1.1 -lfib
39
40 osm2navit_CPPFLAGS = $(AM_CPPFLAGS) @ZLIB_CFLAGS@ @POSTGRESQL_CFLAGS@
41 osm2navit_SOURCES = osm2navit.c
42 osm2navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @POSTGRESQL_LIBS@ @INTLLIBS@
43
44 if EVENT_GLIB
45   libnavit_la_SOURCES += event_glib.c
46 endif
47
48 if !PLUGINS
49   navit_SOURCES += builtin.c
50   navit_LDADD += $(wildcard $(top_builddir)/navit/*/*/*.la)
51   osm2navit_SOURCES += support-builtin.c
52   osm2navit_LDADD += $(wildcard $(top_builddir)/navit/support/*/*.la)
53 endif
54
55 if SUPPORT_WIN32
56   navit_LDADD += resource.rsc
57 if SUPPORT_WIN32CE
58   navit_LDADD += -lcommctrl
59 else
60   navit_LDADD += -lgdi32 -lcomctl32
61 endif
62
63 resource.rsc: $(top_srcdir)/navit/gui/win32/resources/resource.rc
64         $(WINDRES) -I $(top_srcdir)/navit/gui/win32/resources $(top_srcdir)/navit/gui/win32/resources/resource.rc resource.rsc
65 endif
66
67 .PHONY: version.h.tmp
68
69 version.h.tmp:
70         echo "#include \"config.h\"" >version.h.tmp
71 if SOURCE_MODE_SVN
72         echo "#define SVN_VERSION \"$$(LANG=C svnversion 2>/dev/null)\"" >>version.h.tmp
73 else
74         echo "#define SVN_VERSION \"@SOURCE_MODE@\"" >>version.h.tmp
75 endif
76         echo "#define NAVIT_VARIANT \"@NAVIT_VARIANT@\"" >>version.h.tmp
77         if ! diff version.h.tmp version.h >/dev/null 2>/dev/null; \
78         then \
79                 mv version.h.tmp version.h; \
80         fi
81
82 version.h: version.h.tmp
83
84 navit_config.h: ../config.h
85         cp ../config.h navit_config.h.tmp
86         if ! diff navit_config.h.tmp navit_config.h >/dev/null 2>/dev/null; \
87         then \
88                 mv navit_config.h.tmp navit_config.h; \
89         fi
90
91
92 distclean-local:
93         rm -f version.h version.h.tmp navit_config.h navit_config.h.tmp builtin.c support-builtin.c
94
95 builtin.c: $(top_builddir)/config.h
96         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >builtin.c
97         echo "extern void builtin_init(void);" >>builtin.c
98         echo "void builtin_init(void) {" >>builtin.c
99         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/    module_/" >>builtin.c
100         echo "}" >>builtin.c
101 support-builtin.c: $(top_builddir)/config.h
102         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >support-builtin.c
103         echo "extern void builtin_init(void);" >>support-builtin.c
104         echo "void builtin_init(void) {" >>support-builtin.c
105         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/      module_/" >>support-builtin.c
106         echo "}" >>support-builtin.c