--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,34 +1,48 @@
-include $(top_srcdir)/misc/Makefile.common
+CFLAGS = @GLOBAL_CFLAGS@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
 
-SUBDIRS = vm
+lib_LTLIBRARIES = libdvdnav.la
 
-includedir = ${prefix}/include/dvdnav
+libdvdnav_la_SOURCES = decoder.c dvdnav.c vm.c vmcmd.c \
+		       read_cache.c navigation.c highlight.c \
+		       searching.c settings.c
+libdvdnav_la_LDFLAGS = $(DVDREAD_LIBS)		       
 
-AM_CPPFLAGS = $(THREAD_CFLAGS) $(DVDREAD_CFLAGS) \
-	-I$(top_srcdir)/src/vm
+include_HEADERS = decoder.h dvdnav.h dvdnav_events.h \
+	dvdnav_internal.h vm.h vmcmd.h read_cache.h dvd_types.h
 
-EXTRA_DIST = README.MAP FELLOWSHIP.map
+###
+# Install header files (default=$includedir/xine)
+#
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(includedir)/dvdnav
+	@list='$(include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/dvdnav/$$p"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/dvdnav/$$p; \
+	done
 
-lib_LTLIBRARIES = libdvdnav.la libdvdnavmini.la
 
-libdvdnav_la_SOURCES = dvdnav.c \
-	read_cache.c navigation.c highlight.c \
-	searching.c settings.c remap.c \
-	dvdnav_internal.h read_cache.h remap.h
+###
+# Remove them
+#
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	list='$(include_HEADERS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(includedir)/dvdnav/$$p; \
+	done
 
-libdvdnav_la_LIBADD = $(THREAD_LIBS) $(DVDREAD_LIBS) \
-	$(top_builddir)/src/vm/libdvdvm.la
+debug:
+	$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
 
-libdvdnav_la_LDFLAGS = \
-	-version-info $(DVDNAV_LT_CURRENT):$(DVDNAV_LT_REVISION):$(DVDNAV_LT_AGE) \
-	-export-symbols-regex "(^dvdnav.*|^nav.*|^ifo.*|^DVD.*)"
-#	-release $(DVDNAV_MAJOR).$(DVDNAV_MINOR).$(DVDNAV_SUB)
+install-debug: debug
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-libdvdnavmini_la_SOURCES = $(libdvdnav_la_SOURCES)
+mostlyclean-generic:
+	-rm -f *~ \#* .*~ .\#*
 
-libdvdnavmini_la_LIBADD = $(THREAD_LIBS) \
-	$(top_builddir)/src/vm/libdvdvm.la
-
-libdvdnavmini_la_LDFLAGS = $(libdvdnav_la_LDFLAGS)
-
-include_HEADERS = dvdnav/dvdnav.h dvdnav/dvdnav_events.h dvdnav/dvd_types.h
+maintainer-clean-generic:
+	-@echo "This command is intended for maintainers to use;"
+	-@echo "it deletes files that may require special tools to rebuild."
+	-rm -f Makefile.in