+ICONFILE = $(NAME).svg
+DESKTOPFILE = $(NAME).desktop
+MANFILES = $(NAME).1
+XSLTFILES = xslt/*.xslt
+
+MACOSXINSTALL = /Applications/Subsurface.app
+MACOSXFILES = packaging/macosx
+
+# find libdivecomputer
+# First deal with the cross compile environment.
+# For the native case, Linus doesn't want to trust pkg-config given
+# how young libdivecomputer still is - so we check the typical
+# subdirectories of /usr/local and /usr and then we give up. You can
+# override by simply setting it here
+#
+ifeq ($(CC), i686-w64-mingw32-gcc)
+# ok, we are cross building for Windows
+ LIBDIVECOMPUTERDIR = /usr/i686-w64-mingw32/sys-root/mingw/include/libdivecomputer
+ LIBDIVECOMPUTERINCLUDES = `$(PKGCONFIG) --cflags libdivecomputer`
+ LIBDIVECOMPUTERARCHIVE = `$(PKGCONFIG) --libs libdivecomputer`
+ RESFILE = packaging/windows/subsurface.res
+ LDFLAGS += -Wl,-subsystem,windows
+else
+
+libdc-local := $(wildcard /usr/local/lib/libdivecomputer.a)
+libdc-local64 := $(wildcard /usr/local/lib64/libdivecomputer.a)
+libdc-usr := $(wildcard /usr/lib/libdivecomputer.a)
+libdc-usr64 := $(wildcard /usr/lib64/libdivecomputer.a)
+
+ifneq ($(strip $(libdc-local)),)
+ LIBDIVECOMPUTERDIR = /usr/local
+ LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include/libdivecomputer
+ LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a
+else ifneq ($(strip $(libdc-local64)),)
+ LIBDIVECOMPUTERDIR = /usr/local
+ LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include/libdivecomputer
+ LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a
+else ifneq ($(strip $(libdc-usr)),)
+ LIBDIVECOMPUTERDIR = /usr
+ LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include/libdivecomputer
+ LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a
+else ifneq ($(strip $(libdc-usr64)),)
+ LIBDIVECOMPUTERDIR = /usr
+ LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include/libdivecomputer
+ LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a
+else
+$(error Cannot find libdivecomputer - please edit Makefile)
+endif
+endif