Fix:Core:Build osm2navit for wince
[navit-package] / navit / Makefile.am
1 include $(top_srcdir)/Makefile.inc
2 DIST_SUBDIRS=binding data fib-1.1 font gui graphics osd speech support vehicle xpm maps
3 SUBDIRS=binding data fib-1.1 font gui graphics osd speech support vehicle xpm
4 if BUILD_SAMPLEMAP
5   SUBDIRS += maps
6 endif
7
8 AM_CPPFLAGS = -I$(top_srcdir)/navit/fib-1.1 @NAVIT_CFLAGS@ @ZLIB_CFLAGS@ -DPREFIX=\"@prefix@\" -DMODULE=navit
9 BUILT_SOURCES = version.h
10 if BUILD_SAMPLEMAP
11   BUILT_SOURCES += osm2navit$(EXEEXT)
12 endif
13
14 bin_PROGRAMS = navit osm2navit
15
16 pkgdata_DATA = navit.xml
17
18 EXTRA_DIST = navit.xml 
19
20 noinst_LTLIBRARIES        = libnavit.la
21 libnavit_la_SOURCES = attr.c cache.c callback.c compass.c coord.c country.c cursor.c data_window.c debug.c \
22         event.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
23         mapset.c maptype.c menu.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
24         profile.c projection.c route.c search.c speech.c transform.c track.c \
25         util.c vehicle.c xmlconfig.c attr.h attr_def.h cache.h callback.h color.h compass.h coord.h country.h \
26         cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
27         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\
28         map_data.h mapset.h maptype.h menu.h navigation.h navit.h osd.h \
29         param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h search.h speech.h \
30         transform.h track.h util.h vehicle.h window.h xmlconfig.h zipfile.h \
31         navit_nls.h
32
33 navit_SOURCES = start.c
34 navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @INTLLIBS@ -Lfib-1.1 -lfib
35
36 osm2navit_CPPFLAGS = $(AM_CPPFLAGS) @ZLIB_CFLAGS@ @POSTGRESQL_CFLAGS@
37 osm2navit_SOURCES = osm2navit.c
38 osm2navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @POSTGRESQL_LIBS@ @INTLLIBS@
39
40 if EVENT_GLIB
41   libnavit_la_SOURCES += event_glib.c
42 endif
43
44 if !PLUGINS
45   navit_SOURCES += builtin.c
46   navit_LDADD += $(wildcard $(top_builddir)/navit/*/*/*.la)
47   osm2navit_SOURCES += support-builtin.c
48   osm2navit_LDADD += $(wildcard $(top_builddir)/navit/support/*/*.la)
49 endif
50
51 if SUPPORT_WIN32
52   navit_LDADD += resource.rsc
53   navit_LDADD += -lcommctrl
54
55 resource.rsc: $(top_builddir)/navit/gui/win32/resources/resource.rc
56         $(WINDRES) $(top_builddir)/navit/gui/win32/resources/resource.rc resource.rsc
57 endif
58
59 .PHONY: version.h.tmp
60
61 version.h.tmp:
62         echo "#include \"config.h\"" >version.h.tmp
63         echo "#define SVN_VERSION \"$$(LANG=C svnversion 2>/dev/null)\"" >>version.h.tmp
64         if ! diff version.h.tmp version.h >/dev/null 2>/dev/null; \
65         then \
66                 mv version.h.tmp version.h; \
67         fi
68
69 version.h: version.h.tmp
70
71 distclean-local:
72         rm -f version.h version.h.tmp builtin.c
73
74 builtin.c: $(top_builddir)/config.h
75         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >builtin.c
76         echo "extern void builtin_init(void);" >>builtin.c
77         echo "void builtin_init(void) {" >>builtin.c
78         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/    module_/" >>builtin.c
79         echo "}" >>builtin.c
80 support-builtin.c: $(top_builddir)/config.h
81         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >support-builtin.c
82         echo "extern void builtin_init(void);" >>support-builtin.c
83         echo "void builtin_init(void) {" >>support-builtin.c
84         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/      module_/" >>support-builtin.c
85         echo "}" >>support-builtin.c