]> git.tdb.fi Git - ext/subsurface.git/blobdiff - Makefile
Add a simplistic man page
[ext/subsurface.git] / Makefile
index 0c67f40f7838e6f0060606d5a501d80b59584254..862a5cbd0261b93b237ea869b1fe32fe88e4b556 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,18 @@ CC=gcc
 CFLAGS=-Wall -Wno-pointer-sign -g
 INSTALL=install
 
-prefix = $(HOME)
+# these locations seem to work for SuSE and Fedora
+# prefix = $(HOME)
+prefix = /usr
 DESTDIR = $(prefix)/bin
+DESKTOPDIR = $(prefix)/share/applications
+ICONPATH = $(prefix)/share/icons/hicolor
+ICONDIR = $(ICONPATH)/scalable/apps
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(ICONPATH)
+
 NAME = subsurface
+ICONFILE = $(NAME).svg
+DESKTOPFILE = $(NAME).desktop
 
 # find libdivecomputer; we don't trust pkg-config here given how young
 # libdivecomputer still is - so we check /usr/local and /usr and then we
@@ -24,7 +33,7 @@ else ifneq ($(strip $(libdc-usr)),)
        LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer
        LIBDIVECOMPUTERARCHIVE = -ldivecomputer
 else
-       $(error Cannot find libdivecomputer - please edit Makefile)
+$(error Cannot find libdivecomputer - please edit Makefile)
 endif
 
 # Libusb-1.0 is only required if libdivecomputer was built with it.
@@ -49,6 +58,11 @@ $(NAME): $(OBJS)
 install: $(NAME)
        $(INSTALL) -d -m 755 $(DESTDIR)
        $(INSTALL) $(NAME) $(DESTDIR)
+       $(INSTALL) -d -m 755 $(DESKTOPDIR)
+       $(INSTALL) $(DESKTOPFILE) $(DESKTOPDIR)
+       $(INSTALL) -d -m 755 $(ICONDIR)
+       $(INSTALL) $(ICONFILE) $(ICONDIR)
+       $(gtk_update_icon_cache)
 
 parse-xml.o: parse-xml.c dive.h
        $(CC) $(CFLAGS) `pkg-config --cflags glib-2.0` -c `xml2-config --cflags`  parse-xml.c