summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 17 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c019cf8c7..f962c0f01 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,12 @@
+VERSION=1.0
+
CC=gcc
CFLAGS=-Wall -Wno-pointer-sign -g
+INSTALL=install
+
+prefix = $(HOME)
+DESTDIR = $(prefix)/bin
+NAME = subsurface
LIBDIVECOMPUTERDIR = /usr/local
LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer
@@ -21,8 +28,12 @@ OBJS = main.o dive.o profile.o info.o equipment.o divelist.o \
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o \
gtk-gui.o
-subsurface: $(OBJS)
- $(CC) $(LDFLAGS) -o subsurface $(OBJS) $(LIBS)
+$(NAME): $(OBJS)
+ $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
+
+install: $(NAME)
+ $(INSTALL) -d -m 755 '$(DESTDIR)'
+ $(INSTALL) $(NAME) '$(DESTDIR)'
parse-xml.o: parse-xml.c dive.h
$(CC) $(CFLAGS) `pkg-config --cflags glib-2.0` -c `xml2-config --cflags` parse-xml.c
@@ -60,7 +71,11 @@ libdivecomputer.o: libdivecomputer.c dive.h display.h display-gtk.h libdivecompu
gtk-gui.o: gtk-gui.c dive.h display.h divelist.h display-gtk.h libdivecomputer.h
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0 gconf-2.0` \
-I$(LIBDIVECOMPUTERINCLUDES) \
+ -DVERSION_STRING='"v$(VERSION)"' \
-c gtk-gui.c
uemis.o: uemis.c uemis.h
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c uemis.c
+
+clean:
+ rm -f $(OBJS) *~ $(NAME)