2013-05-12 22:10:11 +00:00
|
|
|
NAME = subsurface
|
|
|
|
CAPITALIZED_NAME = Subsurface
|
|
|
|
|
2013-03-04 07:47:58 +00:00
|
|
|
VERSION=3.0.2
|
2011-09-26 18:04:50 +00:00
|
|
|
|
2011-08-30 21:36:34 +00:00
|
|
|
CC=gcc
|
2013-01-27 21:40:54 +00:00
|
|
|
CFLAGS=-Wall -Wno-pointer-sign -g $(CLCFLAGS) -DGSEAL_ENABLE
|
2011-09-23 03:59:10 +00:00
|
|
|
INSTALL=install
|
2011-10-27 16:04:29 +00:00
|
|
|
PKGCONFIG=pkg-config
|
|
|
|
XML2CONFIG=xml2-config
|
2011-11-05 10:39:17 +00:00
|
|
|
XSLCONFIG=xslt-config
|
2011-09-23 03:59:10 +00:00
|
|
|
|
2011-10-11 22:58:38 +00:00
|
|
|
# these locations seem to work for SuSE and Fedora
|
|
|
|
# prefix = $(HOME)
|
2011-10-17 13:53:59 +00:00
|
|
|
prefix = $(DESTDIR)/usr
|
|
|
|
BINDIR = $(prefix)/bin
|
2011-10-12 20:30:08 +00:00
|
|
|
DATADIR = $(prefix)/share
|
|
|
|
DESKTOPDIR = $(DATADIR)/applications
|
|
|
|
ICONPATH = $(DATADIR)/icons/hicolor
|
2011-10-11 22:58:38 +00:00
|
|
|
ICONDIR = $(ICONPATH)/scalable/apps
|
2011-10-12 20:30:08 +00:00
|
|
|
MANDIR = $(DATADIR)/man/man1
|
2013-05-12 22:10:11 +00:00
|
|
|
XSLTDIR = $(DATADIR)/$(NAME)/xslt
|
2011-10-11 22:58:38 +00:00
|
|
|
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(ICONPATH)
|
|
|
|
|
2013-02-02 11:19:28 +00:00
|
|
|
ICONFILE = $(NAME)-icon.svg
|
2011-10-11 22:58:38 +00:00
|
|
|
DESKTOPFILE = $(NAME).desktop
|
2011-10-12 20:30:08 +00:00
|
|
|
MANFILES = $(NAME).1
|
2013-05-08 19:49:57 +00:00
|
|
|
XSLTFILES = xslt/*.xslt xslt/*.xsl
|
2011-08-30 21:36:34 +00:00
|
|
|
|
2013-02-26 17:24:02 +00:00
|
|
|
VERSION_FILE = version.h
|
|
|
|
# There's only one line in $(VERSION_FILE); use the shell builtin `read'
|
|
|
|
STORED_VERSION_STRING = \
|
2013-02-27 11:28:27 +00:00
|
|
|
$(subst ",,$(shell [ ! -r $(VERSION_FILE) ] || \
|
|
|
|
read ignore ignore v <$(VERSION_FILE) && echo $$v))
|
2013-02-26 17:24:02 +00:00
|
|
|
#" workaround editor syntax highlighting quirk
|
|
|
|
|
2013-03-11 16:44:51 +00:00
|
|
|
UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win|gnu|kfreebsd")
|
2013-02-16 22:54:17 +00:00
|
|
|
GET_VERSION = ./scripts/get-version
|
2013-05-12 21:39:12 +00:00
|
|
|
VERSION_STRING := $(shell [ -d .git ] && $(GET_VERSION) linux || \
|
|
|
|
echo "v$(VERSION)")
|
2013-02-16 06:28:31 +00:00
|
|
|
# Mac Info.plist style with three numbers 1.2.3
|
2013-05-12 21:39:12 +00:00
|
|
|
CFBUNDLEVERSION_STRING := $(shell [ -d .git ] && \
|
|
|
|
$(GET_VERSION) darwin $(VERSION_STRING) || \
|
|
|
|
echo "$(VERSION).0")
|
2013-02-16 22:54:17 +00:00
|
|
|
# Windows .nsi style with four numbers 1.2.3.4
|
2013-05-12 21:39:12 +00:00
|
|
|
PRODVERSION_STRING := $(shell [ -d .git ] && \
|
|
|
|
$(GET_VERSION) win $(VERSION_STRING) || \
|
|
|
|
echo "$(VERSION).0.0")
|
2011-10-16 21:16:36 +00:00
|
|
|
|
2013-05-13 16:05:15 +00:00
|
|
|
# 'pretty' output (easy to spot warnings) by default
|
|
|
|
# 'verbose' output (all the details) by calling with "make V=1"
|
|
|
|
ifeq ($(V),1)
|
|
|
|
PRETTYECHO=true
|
|
|
|
COMPILE_PREFIX=
|
|
|
|
else
|
|
|
|
PRETTYECHO=echo
|
|
|
|
COMPILE_PREFIX=@
|
|
|
|
endif
|
|
|
|
|
2011-10-27 16:04:29 +00:00
|
|
|
# find libdivecomputer
|
2011-12-14 19:22:12 +00:00
|
|
|
# First deal with the cross compile environment and with Mac.
|
2011-10-27 16:04:29 +00:00
|
|
|
# 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
|
2011-10-11 00:53:59 +00:00
|
|
|
#
|
2011-10-27 16:04:29 +00:00
|
|
|
ifeq ($(CC), i686-w64-mingw32-gcc)
|
|
|
|
# ok, we are cross building for Windows
|
2012-01-03 19:18:04 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer)
|
|
|
|
LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer)
|
2013-05-12 04:54:04 +00:00
|
|
|
LIBGNUTLS = $(shell $(PKGCONFIG) --libs gnutls-extra) $(shell $(PKGCONFIG) --libs p11-kit-1)
|
2013-05-12 22:10:11 +00:00
|
|
|
RESFILE = packaging/windows/$(NAME).res
|
2011-10-29 17:27:49 +00:00
|
|
|
LDFLAGS += -Wl,-subsystem,windows
|
2013-02-16 03:53:07 +00:00
|
|
|
LIBWINSOCK = -lwsock32
|
2011-12-14 19:22:12 +00:00
|
|
|
else ifeq ($(UNAME), darwin)
|
2012-01-03 19:18:04 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer)
|
|
|
|
LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer)
|
2011-10-27 16:04:29 +00:00
|
|
|
else
|
2011-10-24 11:12:44 +00:00
|
|
|
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)
|
2011-10-11 00:53:59 +00:00
|
|
|
|
2012-11-20 00:26:16 +00:00
|
|
|
ifneq ($(LIBDCDEVEL),)
|
|
|
|
LIBDIVECOMPUTERDIR = ../libdivecomputer
|
|
|
|
LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include
|
|
|
|
LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/src/.libs/libdivecomputer.a
|
|
|
|
else ifneq ($(strip $(libdc-local)),)
|
2011-10-11 00:53:59 +00:00
|
|
|
LIBDIVECOMPUTERDIR = /usr/local
|
2012-07-10 19:33:44 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include
|
2011-10-14 04:06:13 +00:00
|
|
|
LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a
|
2011-10-24 11:12:44 +00:00
|
|
|
else ifneq ($(strip $(libdc-local64)),)
|
|
|
|
LIBDIVECOMPUTERDIR = /usr/local
|
2012-07-10 19:33:44 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include
|
2011-10-24 11:12:44 +00:00
|
|
|
LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a
|
2011-10-11 00:53:59 +00:00
|
|
|
else ifneq ($(strip $(libdc-usr)),)
|
|
|
|
LIBDIVECOMPUTERDIR = /usr
|
2012-07-10 19:33:44 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include
|
2011-10-14 04:06:13 +00:00
|
|
|
LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a
|
2011-10-24 11:12:44 +00:00
|
|
|
else ifneq ($(strip $(libdc-usr64)),)
|
|
|
|
LIBDIVECOMPUTERDIR = /usr
|
2012-07-10 19:33:44 +00:00
|
|
|
LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include
|
2011-10-24 11:12:44 +00:00
|
|
|
LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a
|
2011-10-11 00:53:59 +00:00
|
|
|
else
|
2011-10-12 04:09:46 +00:00
|
|
|
$(error Cannot find libdivecomputer - please edit Makefile)
|
2011-10-11 00:53:59 +00:00
|
|
|
endif
|
2011-10-27 16:04:29 +00:00
|
|
|
endif
|
2011-09-12 16:19:21 +00:00
|
|
|
|
2011-09-22 19:21:20 +00:00
|
|
|
# Libusb-1.0 is only required if libdivecomputer was built with it.
|
|
|
|
# And libdivecomputer is only built with it if libusb-1.0 is
|
|
|
|
# installed. So get libusb if it exists, but don't complain
|
|
|
|
# about it if it doesn't.
|
2011-10-27 16:04:29 +00:00
|
|
|
LIBUSB = $(shell $(PKGCONFIG) --libs libusb-1.0 2> /dev/null)
|
|
|
|
|
2011-11-25 06:32:10 +00:00
|
|
|
LIBGTK = $(shell $(PKGCONFIG) --libs gtk+-2.0 glib-2.0)
|
2011-10-27 16:04:29 +00:00
|
|
|
LIBDIVECOMPUTERCFLAGS = $(LIBDIVECOMPUTERINCLUDES)
|
2011-09-22 19:21:20 +00:00
|
|
|
LIBDIVECOMPUTER = $(LIBDIVECOMPUTERARCHIVE) $(LIBUSB)
|
|
|
|
|
2011-11-24 06:56:57 +00:00
|
|
|
LIBXML2 = $(shell $(XML2CONFIG) --libs)
|
|
|
|
LIBXSLT = $(shell $(XSLCONFIG) --libs)
|
|
|
|
XML2CFLAGS = $(shell $(XML2CONFIG) --cflags)
|
|
|
|
GLIB2CFLAGS = $(shell $(PKGCONFIG) --cflags glib-2.0)
|
2013-01-27 21:52:42 +00:00
|
|
|
GTKCFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-2.0)
|
2011-11-24 06:56:57 +00:00
|
|
|
CFLAGS += $(shell $(XSLCONFIG) --cflags)
|
2013-01-31 03:41:02 +00:00
|
|
|
OSMGPSMAPFLAGS += $(shell $(PKGCONFIG) --cflags osmgpsmap 2> /dev/null)
|
2013-01-17 18:59:43 +00:00
|
|
|
LIBOSMGPSMAP += $(shell $(PKGCONFIG) --libs osmgpsmap 2> /dev/null)
|
|
|
|
ifneq ($(strip $(LIBOSMGPSMAP)),)
|
|
|
|
GPSOBJ = gps.o
|
|
|
|
CFLAGS += -DHAVE_OSM_GPS_MAP
|
|
|
|
endif
|
2013-01-18 01:05:49 +00:00
|
|
|
LIBSOUPCFLAGS = $(shell $(PKGCONFIG) --cflags libsoup-2.4)
|
|
|
|
LIBSOUP = $(shell $(PKGCONFIG) --libs libsoup-2.4)
|
2011-11-24 06:56:57 +00:00
|
|
|
|
2012-01-27 01:43:33 +00:00
|
|
|
LIBZIP = $(shell $(PKGCONFIG) --libs libzip 2> /dev/null)
|
|
|
|
ifneq ($(strip $(LIBZIP)),)
|
|
|
|
ZIP = -DLIBZIP $(shell $(PKGCONFIG) --cflags libzip)
|
|
|
|
endif
|
|
|
|
|
2013-03-05 05:10:39 +00:00
|
|
|
LIBSQLITE3 = $(shell $(PKGCONFIG) --libs sqlite3 2> /dev/null)
|
|
|
|
ifneq ($(strip $(LIBSQLITE3)),)
|
|
|
|
SQLITE3 = -DSQLITE3 $(shell $(PKGCONFIG) --cflags sqlite3)
|
|
|
|
endif
|
|
|
|
|
2013-03-11 16:44:51 +00:00
|
|
|
ifneq (,$(filter $(UNAME),linux kfreebsd gnu))
|
2011-11-25 06:32:10 +00:00
|
|
|
LIBGCONF2 = $(shell $(PKGCONFIG) --libs gconf-2.0)
|
|
|
|
GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0)
|
2011-11-24 06:56:57 +00:00
|
|
|
OSSUPPORT = linux
|
2013-01-27 21:52:42 +00:00
|
|
|
OSSUPPORT_CFLAGS = $(GTKCFLAGS) $(GCONF2CFLAGS)
|
2011-11-25 06:32:10 +00:00
|
|
|
else ifeq ($(UNAME), darwin)
|
2011-11-24 06:56:57 +00:00
|
|
|
OSSUPPORT = macos
|
2013-01-27 21:52:42 +00:00
|
|
|
OSSUPPORT_CFLAGS = $(GTKCFLAGS)
|
2013-05-12 22:10:11 +00:00
|
|
|
MACOSXINSTALL = /Applications/$(CAPITALIZED_NAME).app
|
2011-12-14 19:22:12 +00:00
|
|
|
MACOSXFILES = packaging/macosx
|
2013-05-12 22:10:11 +00:00
|
|
|
MACOSXSTAGING = $(MACOSXFILES)/$(CAPITALIZED_NAME).app
|
2013-02-16 06:28:31 +00:00
|
|
|
INFOPLIST = $(MACOSXFILES)/Info.plist
|
|
|
|
INFOPLISTINPUT = $(INFOPLIST).in
|
2013-02-28 13:56:23 +00:00
|
|
|
EXTRALIBS = $(shell $(PKGCONFIG) --libs gtk-mac-integration) -framework CoreFoundation -framework CoreServices
|
2012-01-03 19:18:04 +00:00
|
|
|
CFLAGS += $(shell $(PKGCONFIG) --cflags gtk-mac-integration)
|
2013-02-16 06:28:31 +00:00
|
|
|
LDFLAGS += -headerpad_max_install_names -sectcreate __TEXT __info_plist $(INFOPLIST)
|
2012-10-17 04:24:02 +00:00
|
|
|
GTK_MAC_BUNDLER = ~/.local/bin/gtk-mac-bundler
|
2011-11-24 06:56:57 +00:00
|
|
|
else
|
|
|
|
OSSUPPORT = windows
|
2013-01-27 21:52:42 +00:00
|
|
|
OSSUPPORT_CFLAGS = $(GTKCFLAGS)
|
2012-10-16 11:04:37 +00:00
|
|
|
WINDOWSSTAGING = ./packaging/windows
|
2012-10-17 04:24:02 +00:00
|
|
|
WINMSGDIRS=$(addprefix share/locale/,$(shell ls po/*.po | sed -e 's/po\/\(..\)_.*/\1\/LC_MESSAGES/'))
|
2013-05-12 22:10:11 +00:00
|
|
|
NSIINPUTFILE = $(WINDOWSSTAGING)/$(NAME).nsi.in
|
|
|
|
NSIFILE = $(WINDOWSSTAGING)/$(NAME).nsi
|
2013-01-24 23:58:35 +00:00
|
|
|
MAKENSIS = makensis
|
2013-02-22 19:20:46 +00:00
|
|
|
XSLTDIR = .\\xslt
|
2011-11-24 06:56:57 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(strip $(LIBXSLT)),)
|
2013-02-22 19:20:46 +00:00
|
|
|
XSLT=-DXSLT='"$(XSLTDIR)"'
|
2011-11-24 06:56:57 +00:00
|
|
|
endif
|
|
|
|
|
2013-05-12 04:54:04 +00:00
|
|
|
LIBS = $(LIBXML2) $(LIBXSLT) $(LIBSQLITE3) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) $(LIBZIP) -lpthread -lm $(LIBOSMGPSMAP) $(LIBSOUP) $(LIBWINSOCK) $(LIBGNUTLS)
|
2011-09-20 10:22:45 +00:00
|
|
|
|
2013-03-14 09:24:14 +00:00
|
|
|
MSGLANGS=$(notdir $(wildcard po/*.po))
|
2013-05-12 22:10:11 +00:00
|
|
|
MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/$(NAME).mo))
|
2012-10-12 08:05:41 +00:00
|
|
|
|
2013-04-15 03:10:25 +00:00
|
|
|
GTKOBJS = info-gtk.o divelist-gtk.o planner-gtk.o statistics-gtk.o gtk-gui.o
|
2013-04-14 18:31:26 +00:00
|
|
|
|
|
|
|
OBJS = main.o dive.o time.o profile.o info.o equipment.o divelist.o deco.o planner.o \
|
2012-09-25 14:28:47 +00:00
|
|
|
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o uemis-downloader.o \
|
2013-05-12 03:07:28 +00:00
|
|
|
statistics.o file.o device.o download-dialog.o prefs.o \
|
2013-04-14 18:31:26 +00:00
|
|
|
webservice.o sha1.o $(GPSOBJ) $(OSSUPPORT).o $(RESFILE) $(GTKOBJS)
|
2011-08-31 17:20:46 +00:00
|
|
|
|
2013-01-31 02:48:59 +00:00
|
|
|
DEPS = $(wildcard .dep/*.dep)
|
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
all: $(NAME)
|
|
|
|
|
2013-02-26 20:19:01 +00:00
|
|
|
$(NAME): gen_version_file $(OBJS) $(MSGOBJS) $(INFOPLIST)
|
2013-05-13 16:05:15 +00:00
|
|
|
@$(PRETTYECHO) ' LINK' $(NAME)
|
|
|
|
$(COMPILE_PREFIX)$(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
|
2013-02-26 20:19:01 +00:00
|
|
|
|
2013-02-26 17:24:02 +00:00
|
|
|
gen_version_file:
|
|
|
|
ifneq ($(STORED_VERSION_STRING),$(VERSION_STRING))
|
|
|
|
$(info updating $(VERSION_FILE) to $(VERSION_STRING))
|
|
|
|
@echo \#define VERSION_STRING \"$(VERSION_STRING)\" >$(VERSION_FILE)
|
|
|
|
endif
|
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
install: all
|
2011-10-17 13:53:59 +00:00
|
|
|
$(INSTALL) -d -m 755 $(BINDIR)
|
|
|
|
$(INSTALL) $(NAME) $(BINDIR)
|
2011-10-11 22:58:38 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DESKTOPDIR)
|
|
|
|
$(INSTALL) $(DESKTOPFILE) $(DESKTOPDIR)
|
|
|
|
$(INSTALL) -d -m 755 $(ICONDIR)
|
2013-03-04 10:25:44 +00:00
|
|
|
$(INSTALL) -m 644 $(ICONFILE) $(ICONDIR)
|
2011-10-31 20:05:55 +00:00
|
|
|
@-if test -z "$(DESTDIR)"; then \
|
|
|
|
$(gtk_update_icon_cache); \
|
|
|
|
fi
|
2011-10-24 11:12:44 +00:00
|
|
|
$(INSTALL) -d -m 755 $(MANDIR)
|
|
|
|
$(INSTALL) -m 644 $(MANFILES) $(MANDIR)
|
2011-11-05 10:39:17 +00:00
|
|
|
@-if test ! -z "$(XSLT)"; then \
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DATADIR)/$(NAME); \
|
2011-11-05 10:39:17 +00:00
|
|
|
$(INSTALL) -d -m 755 $(XSLTDIR); \
|
|
|
|
$(INSTALL) -m 644 $(XSLTFILES) $(XSLTDIR); \
|
|
|
|
fi
|
2012-10-17 06:46:59 +00:00
|
|
|
for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \
|
2013-03-04 10:25:44 +00:00
|
|
|
$(INSTALL) -d $(prefix)/$$LOC; \
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) -m 644 $$LOC/$(NAME).mo $(prefix)/$$LOC/$(NAME).mo; \
|
2012-10-17 06:46:59 +00:00
|
|
|
done
|
|
|
|
|
2011-09-23 03:59:10 +00:00
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
install-macosx: all
|
2011-10-16 21:16:36 +00:00
|
|
|
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/MacOS
|
2012-10-21 04:06:35 +00:00
|
|
|
$(INSTALL) $(NAME) $(MACOSXINSTALL)/Contents/MacOS/$(NAME)-bin
|
|
|
|
$(INSTALL) $(MACOSXFILES)/$(NAME).sh $(MACOSXINSTALL)/Contents/MacOS/$(NAME)
|
2011-10-30 21:27:33 +00:00
|
|
|
$(INSTALL) $(MACOSXFILES)/PkgInfo $(MACOSXINSTALL)/Contents/
|
|
|
|
$(INSTALL) $(MACOSXFILES)/Info.plist $(MACOSXINSTALL)/Contents/
|
|
|
|
$(INSTALL) $(ICONFILE) $(MACOSXINSTALL)/Contents/Resources/
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) $(MACOSXFILES)/$(CAPITALIZED_NAME).icns $(MACOSXINSTALL)/Contents/Resources/
|
2012-10-17 04:24:02 +00:00
|
|
|
for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources/$$LOC; \
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) $$LOC/$(NAME).mo $(MACOSXINSTALL)/Contents/Resources/$$LOC/$(NAME).mo; \
|
2012-10-15 12:44:01 +00:00
|
|
|
done
|
2013-02-09 09:36:02 +00:00
|
|
|
@-if test ! -z "$(XSLT)"; then \
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources/xslt; \
|
|
|
|
$(INSTALL) -m 644 $(XSLTFILES) $(MACOSXINSTALL)/Contents/Resources/xslt/; \
|
|
|
|
fi
|
|
|
|
|
2011-10-16 21:16:36 +00:00
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
create-macosx-bundle: all
|
2012-10-17 04:24:02 +00:00
|
|
|
$(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/MacOS
|
|
|
|
$(INSTALL) $(NAME) $(MACOSXSTAGING)/Contents/MacOS/
|
|
|
|
$(INSTALL) $(MACOSXFILES)/PkgInfo $(MACOSXSTAGING)/Contents/
|
|
|
|
$(INSTALL) $(MACOSXFILES)/Info.plist $(MACOSXSTAGING)/Contents/
|
|
|
|
$(INSTALL) $(ICONFILE) $(MACOSXSTAGING)/Contents/Resources/
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) $(MACOSXFILES)/$(CAPITALIZED_NAME).icns $(MACOSXSTAGING)/Contents/Resources/
|
2012-10-17 04:24:02 +00:00
|
|
|
for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources/$$LOC; \
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) $$LOC/$(NAME).mo $(MACOSXSTAGING)/Contents/Resources/$$LOC/$(NAME).mo; \
|
2012-10-17 04:24:02 +00:00
|
|
|
done
|
2013-02-09 09:36:02 +00:00
|
|
|
@-if test ! -z "$(XSLT)"; then \
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources/xslt; \
|
|
|
|
$(INSTALL) -m 644 $(XSLTFILES) $(MACOSXSTAGING)/Contents/Resources/xslt/; \
|
|
|
|
fi
|
2013-05-12 22:10:11 +00:00
|
|
|
$(GTK_MAC_BUNDLER) packaging/macosx/$(NAME).bundle
|
2012-10-17 04:24:02 +00:00
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
sign-macosx-bundle: all
|
2013-05-12 22:10:11 +00:00
|
|
|
codesign -s "3A8CE62A483083EDEA5581A61E770EC1FA8BECE8" /Applications/$(CAPITALIZED_NAME).app/Contents/MacOS/$(NAME)-bin
|
2013-02-14 17:19:28 +00:00
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
install-cross-windows: all
|
2012-10-16 11:04:37 +00:00
|
|
|
$(INSTALL) -d -m 755 $(WINDOWSSTAGING)/share/locale
|
|
|
|
for MSG in $(WINMSGDIRS); do\
|
2012-10-17 04:24:02 +00:00
|
|
|
$(INSTALL) -d -m 755 $(WINDOWSSTAGING)/$$MSG;\
|
2012-10-17 06:55:35 +00:00
|
|
|
$(INSTALL) $(CROSS_PATH)/$$MSG/* $(WINDOWSSTAGING)/$$MSG;\
|
2012-10-16 11:04:37 +00:00
|
|
|
done
|
2012-10-17 06:46:59 +00:00
|
|
|
for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \
|
|
|
|
$(INSTALL) -d -m 755 $(WINDOWSSTAGING)/$$LOC; \
|
2013-05-12 22:10:11 +00:00
|
|
|
$(INSTALL) $$LOC/$(NAME).mo $(WINDOWSSTAGING)/$$LOC/$(NAME).mo; \
|
2012-10-16 11:04:37 +00:00
|
|
|
done
|
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
create-windows-installer: all $(NSIFILE) install-cross-windows
|
2013-01-24 23:58:35 +00:00
|
|
|
$(MAKENSIS) $(NSIFILE)
|
|
|
|
|
2013-02-16 06:28:31 +00:00
|
|
|
$(NSIFILE): $(NSIINPUTFILE)
|
2013-01-24 23:58:35 +00:00
|
|
|
$(shell cat $(NSIINPUTFILE) | sed -e 's/VERSIONTOKEN/$(VERSION_STRING)/;s/PRODVTOKEN/$(PRODVERSION_STRING)/' > $(NSIFILE))
|
|
|
|
|
2013-02-16 06:28:31 +00:00
|
|
|
$(INFOPLIST): $(INFOPLISTINPUT)
|
|
|
|
$(shell cat $(INFOPLISTINPUT) | sed -e 's/CFBUNDLEVERSION_TOKEN/$(CFBUNDLEVERSION_STRING)/' > $(INFOPLIST))
|
2013-01-24 23:58:35 +00:00
|
|
|
|
2013-02-25 16:23:54 +00:00
|
|
|
# Transifex merge the translations
|
2012-10-18 21:53:27 +00:00
|
|
|
update-po-files:
|
2013-05-02 15:39:47 +00:00
|
|
|
tx pull -af
|
|
|
|
|
|
|
|
push-pot:
|
2013-05-12 22:10:11 +00:00
|
|
|
xgettext -o po/$(NAME)-new.pot -s -k_ -kN_ --keyword=C_:1c,2 --add-comments="++GETTEXT" *.c
|
2013-02-25 16:23:54 +00:00
|
|
|
tx push -s
|
2013-02-09 18:52:01 +00:00
|
|
|
|
2013-01-31 02:48:59 +00:00
|
|
|
EXTRA_FLAGS = $(GTKCFLAGS) $(GLIB2CFLAGS) $(XML2CFLAGS) \
|
2013-03-05 05:10:39 +00:00
|
|
|
$(XSLT) $(ZIP) $(SQLITE3) $(LIBDIVECOMPUTERCFLAGS) \
|
2013-02-26 17:24:02 +00:00
|
|
|
$(LIBSOUPCFLAGS) $(OSMGPSMAPFLAGS) $(GCONF2CFLAGS)
|
2013-01-23 03:52:07 +00:00
|
|
|
|
2013-01-31 02:48:59 +00:00
|
|
|
%.o: %.c
|
2013-05-13 16:05:15 +00:00
|
|
|
@$(PRETTYECHO) ' CC' $<
|
2013-01-31 02:48:59 +00:00
|
|
|
@mkdir -p .dep
|
2013-05-13 16:05:15 +00:00
|
|
|
$(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
|
2011-11-24 06:56:57 +00:00
|
|
|
|
2013-05-12 22:10:11 +00:00
|
|
|
share/locale/%.UTF-8/LC_MESSAGES/$(NAME).mo: po/%.po po/%.aliases
|
2012-10-12 08:05:41 +00:00
|
|
|
mkdir -p $(dir $@)
|
|
|
|
msgfmt -c -o $@ po/$*.po
|
2012-10-16 19:21:11 +00:00
|
|
|
@-if test -s po/$*.aliases; then \
|
2012-10-16 13:09:34 +00:00
|
|
|
for ALIAS in `cat po/$*.aliases`; do \
|
2012-10-17 04:24:02 +00:00
|
|
|
mkdir -p share/locale/$$ALIAS/LC_MESSAGES; \
|
|
|
|
cp $@ share/locale/$$ALIAS/LC_MESSAGES; \
|
2012-10-16 13:09:34 +00:00
|
|
|
done; \
|
|
|
|
fi
|
2012-10-11 10:06:56 +00:00
|
|
|
|
2013-02-02 11:45:05 +00:00
|
|
|
satellite.png: satellite.svg
|
|
|
|
convert -transparent white -resize 11x16 -depth 8 $< $@
|
|
|
|
|
|
|
|
# This should work, but it doesn't get the colors quite right - so I manually converted with Gimp
|
2013-05-12 22:10:11 +00:00
|
|
|
# convert -colorspace RGB -transparent white -resize 256x256 $(NAME)-icon.svg $(NAME)-icon.png
|
2013-02-01 06:25:41 +00:00
|
|
|
#
|
2013-02-02 11:45:05 +00:00
|
|
|
# The following creates the pixbuf data in .h files with the basename followed by '_pixmap'
|
2013-02-01 06:25:41 +00:00
|
|
|
# as name of the data structure
|
|
|
|
%.h: %.png
|
2013-05-13 16:05:15 +00:00
|
|
|
@$(PRETTYECHO) ' gdk-pixbuf-csource' $<
|
|
|
|
$(COMPILE_PREFIX)gdk-pixbuf-csource --struct --name `echo $* | sed 's/-/_/g'`_pixbuf $< > $@
|
2013-02-01 06:25:41 +00:00
|
|
|
|
First try at converting user-manual to AsciiDoc
You can do "make doc" in the main directory to create the html version,
and if you want to play around with it, do "make show" in the
Documentation subdirectory to start firefox on the end result.
It's by no means perfect, but it gives somewhat reasonable results, and
this is enough initial work for people to play around with, I think.
NOTE! You need "asciidoc" installed to do this: it's a python program,
so it should be pretty easy even on non-Linux platforms. And on Linux,
most distributions package it, so you just have to do something like
yum install asciidoc
to get it (replace with apt-get/zypper/whatever).
Asciidoc can generate other output too (man-pages, LaTeX, etc), maybe
people want to play with that part too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-01 23:12:28 +00:00
|
|
|
doc:
|
|
|
|
$(MAKE) -C Documentation doc
|
|
|
|
|
2011-09-27 16:43:53 +00:00
|
|
|
clean:
|
2013-05-12 22:10:11 +00:00
|
|
|
rm -f $(OBJS) *~ $(NAME) $(NAME).exe po/*~ po/$(NAME)-new.pot \
|
2013-02-26 17:24:02 +00:00
|
|
|
$(VERSION_FILE)
|
2013-01-31 02:48:59 +00:00
|
|
|
rm -rf share .dep
|
|
|
|
|
2013-05-08 22:55:44 +00:00
|
|
|
release:
|
2013-05-12 09:52:32 +00:00
|
|
|
@scripts/check-version -cr $(VERSION_STRING)
|
2013-05-12 22:10:11 +00:00
|
|
|
git archive --prefix $(CAPITALIZED_NAME)-$(VERSION_STRING)/ \
|
|
|
|
--output $(CAPITALIZED_NAME)-$(VERSION_STRING).tgz \
|
|
|
|
v$(VERSION_STRING)
|
2013-05-08 22:55:44 +00:00
|
|
|
|
2013-01-31 02:48:59 +00:00
|
|
|
-include $(DEPS)
|