Fix:Various:Made work on win32
[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 if PLUGINS
54   navit_LDADD += -lcommctrl
55 else
56   navit_LDADD += -lgdi32 -lcomctl32
57 endif
58
59 resource.rsc: $(top_srcdir)/navit/gui/win32/resources/resource.rc
60         $(WINDRES) -I $(top_srcdir)/navit/gui/win32/resources $(top_srcdir)/navit/gui/win32/resources/resource.rc resource.rsc
61 endif
62
63 .PHONY: version.h.tmp
64
65 version.h.tmp:
66         echo "#include \"config.h\"" >version.h.tmp
67 if SOURCE_MODE_SVN
68         echo "#define SVN_VERSION \"$$(LANG=C svnversion 2>/dev/null)\"" >>version.h.tmp
69 else
70         echo "#define SVN_VERSION \"@SOURCE_MODE@\"" >>version.h.tmp
71 endif
72         if ! diff version.h.tmp version.h >/dev/null 2>/dev/null; \
73         then \
74                 mv version.h.tmp version.h; \
75         fi
76
77 version.h: version.h.tmp
78
79 distclean-local:
80         rm -f version.h version.h.tmp builtin.c support-builtin.c
81
82 builtin.c: $(top_builddir)/config.h
83         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >builtin.c
84         echo "extern void builtin_init(void);" >>builtin.c
85         echo "void builtin_init(void) {" >>builtin.c
86         ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/    module_/" >>builtin.c
87         echo "}" >>builtin.c
88 support-builtin.c: $(top_builddir)/config.h
89         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >support-builtin.c
90         echo "extern void builtin_init(void);" >>support-builtin.c
91         echo "void builtin_init(void) {" >>support-builtin.c
92         ls $(top_builddir)/navit/support/*/*.la | sed -e "s/.la/_init();/" -e "s/.*\\/lib/      module_/" >>support-builtin.c
93         echo "}" >>support-builtin.c