4 CFLAGS=-Wall -Wno-pointer-sign -g
8 DESTDIR = $(prefix)/bin
11 # find libdivecomputer; we don't trust pkg-config here given how young
12 # libdivecomputer still is - so we check /usr/local and /usr and then we
13 # give up. You can override by simply setting it here
15 libdc-local := $(wildcard /usr/local/include/libdivecomputer/*)
16 libdc-usr := $(wildcard /usr/include/libdivecomputer/*)
18 ifneq ($(strip $(libdc-local)),)
19 LIBDIVECOMPUTERDIR = /usr/local
20 LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer
21 LIBDIVECOMPUTERARCHIVE = -L$(LIBDIVECOMPUTERDIR)/lib -ldivecomputer
22 else ifneq ($(strip $(libdc-usr)),)
23 LIBDIVECOMPUTERDIR = /usr
24 LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer
25 LIBDIVECOMPUTERARCHIVE = -ldivecomputer
27 $(error Cannot find libdivecomputer - please edit Makefile)
30 # Libusb-1.0 is only required if libdivecomputer was built with it.
31 # And libdivecomputer is only built with it if libusb-1.0 is
32 # installed. So get libusb if it exists, but don't complain
33 # about it if it doesn't.
34 LIBUSB = $(shell pkg-config --libs libusb-1.0 2> /dev/null)
36 LIBXML2 = $(shell xml2-config --libs)
37 LIBGTK = $(shell pkg-config --libs gtk+-2.0 glib-2.0 gconf-2.0)
38 LIBDIVECOMPUTER = $(LIBDIVECOMPUTERARCHIVE) $(LIBUSB)
40 LIBS = $(LIBXML2) $(LIBGTK) $(LIBDIVECOMPUTER) -lpthread
42 OBJS = main.o dive.o profile.o info.o equipment.o divelist.o \
43 parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o \
47 $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
50 $(INSTALL) -d -m 755 '$(DESTDIR)'
51 $(INSTALL) $(NAME) '$(DESTDIR)'
53 parse-xml.o: parse-xml.c dive.h
54 $(CC) $(CFLAGS) `pkg-config --cflags glib-2.0` -c `xml2-config --cflags` parse-xml.c
56 save-xml.o: save-xml.c dive.h
57 $(CC) $(CFLAGS) `pkg-config --cflags glib-2.0` -c save-xml.c
60 $(CC) $(CFLAGS) `pkg-config --cflags glib-2.0` -c dive.c
62 main.o: main.c dive.h display.h divelist.h
63 $(CC) $(CFLAGS) `pkg-config --cflags glib-2.0 gconf-2.0` \
66 profile.o: profile.c dive.h display.h divelist.h
67 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c profile.c
69 info.o: info.c dive.h display.h display-gtk.h divelist.h
70 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c info.c
72 equipment.o: equipment.c dive.h display.h divelist.h
73 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c equipment.c
75 divelist.o: divelist.c dive.h display.h divelist.h
76 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c divelist.c
78 print.o: print.c dive.h display.h display-gtk.h
79 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c print.c
81 libdivecomputer.o: libdivecomputer.c dive.h display.h display-gtk.h libdivecomputer.h
82 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` \
83 -I$(LIBDIVECOMPUTERINCLUDES) \
86 gtk-gui.o: gtk-gui.c dive.h display.h divelist.h display-gtk.h libdivecomputer.h
87 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0 gconf-2.0` \
88 -I$(LIBDIVECOMPUTERINCLUDES) \
89 -DVERSION_STRING='"v$(VERSION)"' \
92 uemis.o: uemis.c uemis.h
93 $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 glib-2.0` -c uemis.c
96 rm -f $(OBJS) *~ $(NAME)