X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=Makefile;h=c87513025f8a0770afccead8b4064eae517065fa;hb=513df18f50afc13fcef9f2421b5a33b772eed380;hp=0b0dd2f5f81b8ca9dcf33154af96ffc15221a79e;hpb=290ce56d0181c0c7e7d6e1af3eb27d3015cffca7;p=ext%2Fsubsurface.git diff --git a/Makefile b/Makefile index 0b0dd2f..c875130 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=1.1 +VERSION=1.2 CC=gcc CFLAGS=-Wall -Wno-pointer-sign -g @@ -25,11 +25,10 @@ DESKTOPFILE = $(NAME).desktop MANFILES = $(NAME).1 XSLTFILES = xslt/*.xslt -MACOSXINSTALL = /Applications/Subsurface.app -MACOSXFILES = packaging/macosx +UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win") # find libdivecomputer -# First deal with the cross compile environment. +# First deal with the cross compile environment and with Mac. # 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 @@ -37,13 +36,14 @@ MACOSXFILES = packaging/macosx # 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 ifeq ($(UNAME), darwin) + LIBDIVECOMPUTERINCLUDES = `$(PKGCONFIG) --cflags libdivecomputer` + LIBDIVECOMPUTERARCHIVE = `$(PKGCONFIG) --libs libdivecomputer` else - libdc-local := $(wildcard /usr/local/lib/libdivecomputer.a) libdc-local64 := $(wildcard /usr/local/lib64/libdivecomputer.a) libdc-usr := $(wildcard /usr/lib/libdivecomputer.a) @@ -76,7 +76,7 @@ endif # about it if it doesn't. LIBUSB = $(shell $(PKGCONFIG) --libs libusb-1.0 2> /dev/null) -LIBGTK = $(shell $(PKGCONFIG) --libs gtk+-2.0 glib-2.0 gconf-2.0) +LIBGTK = $(shell $(PKGCONFIG) --libs gtk+-2.0 glib-2.0) LIBDIVECOMPUTERCFLAGS = $(LIBDIVECOMPUTERINCLUDES) LIBDIVECOMPUTER = $(LIBDIVECOMPUTERARCHIVE) $(LIBUSB) @@ -84,18 +84,21 @@ LIBXML2 = $(shell $(XML2CONFIG) --libs) LIBXSLT = $(shell $(XSLCONFIG) --libs) XML2CFLAGS = $(shell $(XML2CONFIG) --cflags) GLIB2CFLAGS = $(shell $(PKGCONFIG) --cflags glib-2.0) -GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0) GTK2CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-2.0) CFLAGS += $(shell $(XSLCONFIG) --cflags) -UNAME := $(shell uname) - -ifeq ($(UNAME), Linux) +ifeq ($(UNAME), linux) + LIBGCONF2 = $(shell $(PKGCONFIG) --libs gconf-2.0) + GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0) OSSUPPORT = linux OSSUPPORT_CFLAGS = $(GTK2CFLAGS) $(GCONF2CFLAGS) -else ifeq ($(UNAME), Darwin) +else ifeq ($(UNAME), darwin) OSSUPPORT = macos OSSUPPORT_CFLAGS = $(GTK2CFLAGS) + MACOSXINSTALL = /Applications/Subsurface.app + MACOSXFILES = packaging/macosx + EXTRALIBS = `$(PKGCONFIG) --libs gtk-mac-integration` -framework CoreFoundation + CFLAGS += `$(PKGCONFIG) --cflags gtk-mac-integration` else OSSUPPORT = windows OSSUPPORT_CFLAGS = $(GTK2CFLAGS) @@ -108,7 +111,7 @@ ifneq ($(strip $(LIBXSLT)),) endif endif -LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBDIVECOMPUTER) -lpthread +LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) -lpthread 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 \ @@ -192,5 +195,8 @@ uemis.o: uemis.c dive.h uemis.h $(OSSUPPORT).o: $(OSSUPPORT).c display-gtk.h $(CC) $(CFLAGS) $(OSSUPPORT_CFLAGS) -c $(OSSUPPORT).c +doc: + $(MAKE) -C Documentation doc + clean: rm -f $(OBJS) *~ $(NAME)