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
|
2013-04-01 09:25:15 +00:00
|
|
|
CXX=g++
|
2013-04-07 22:20:43 +00:00
|
|
|
CXXFLAGS=-Wall -g $(CLCFLAGS) -fPIC -DQT_NO_KEYWORDS
|
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
|
2013-04-01 09:25:15 +00:00
|
|
|
QMAKE=qmake
|
|
|
|
MOC=moc
|
|
|
|
UIC=uic
|
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
|
2011-11-05 10:39:17 +00:00
|
|
|
XSLTDIR = $(DATADIR)/subsurface/xslt
|
2011-10-11 22:58:38 +00:00
|
|
|
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(ICONPATH)
|
|
|
|
|
2011-09-27 16:43:53 +00:00
|
|
|
NAME = subsurface
|
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
|
2011-11-05 10:39:17 +00:00
|
|
|
XSLTFILES = xslt/*.xslt
|
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
|
|
|
|
VERSION_STRING := $(shell $(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-02-16 22:54:17 +00:00
|
|
|
CFBUNDLEVERSION_STRING := $(shell $(GET_VERSION) darwin $(VERSION_STRING) || \
|
|
|
|
echo "$(VERSION).0")
|
|
|
|
# Windows .nsi style with four numbers 1.2.3.4
|
|
|
|
PRODVERSION_STRING := $(shell $(GET_VERSION) win $(VERSION_STRING) || \
|
|
|
|
echo "$(VERSION).0.0")
|
2011-10-16 21:16:36 +00:00
|
|
|
|
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)
|
2011-10-29 16:14:15 +00:00
|
|
|
RESFILE = packaging/windows/subsurface.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)
|
|
|
|
|
2013-04-01 09:25:15 +00:00
|
|
|
# Use qmake to find out which Qt version we are building for.
|
|
|
|
QT_VERSION_MAJOR = $(shell $(QMAKE) -query QT_VERSION | cut -d. -f1)
|
|
|
|
ifeq ($(QT_VERSION_MAJOR), 5)
|
|
|
|
QT_MODULES = Qt5Widgets
|
|
|
|
QT_CORE = Qt5Core
|
|
|
|
else
|
|
|
|
QT_MODULES = QtGui
|
|
|
|
QT_CORE = QtCore
|
|
|
|
endif
|
|
|
|
LIBQT = $(shell $(PKGCONFIG) --libs $(QT_MODULES))
|
|
|
|
QTCXXFLAGS = $(shell $(PKGCONFIG) --cflags $(QT_MODULES))
|
|
|
|
|
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)
|
2013-04-01 09:25:15 +00:00
|
|
|
ifneq ($(findstring reduce_relocations, $(shell $(PKGCONFIG) --variable qt_config $(QT_CORE))),)
|
|
|
|
CXXFLAGS += -fPIE
|
|
|
|
endif
|
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)
|
2011-12-14 19:22:12 +00:00
|
|
|
MACOSXINSTALL = /Applications/Subsurface.app
|
|
|
|
MACOSXFILES = packaging/macosx
|
2012-10-17 04:24:02 +00:00
|
|
|
MACOSXSTAGING = $(MACOSXFILES)/Subsurface.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-01-24 23:58:35 +00:00
|
|
|
NSIINPUTFILE = $(WINDOWSSTAGING)/subsurface.nsi.in
|
|
|
|
NSIFILE = $(WINDOWSSTAGING)/subsurface.nsi
|
|
|
|
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-04-01 09:25:15 +00:00
|
|
|
LIBS = $(LIBQT) $(LIBXML2) $(LIBXSLT) $(LIBSQLITE3) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) $(LIBZIP) -lpthread -lm $(LIBOSMGPSMAP) $(LIBSOUP) $(LIBWINSOCK)
|
2011-09-20 10:22:45 +00:00
|
|
|
|
2013-03-14 09:24:14 +00:00
|
|
|
MSGLANGS=$(notdir $(wildcard po/*.po))
|
|
|
|
MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/subsurface.mo))
|
2012-10-12 08:05:41 +00:00
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
|
|
|
|
QTOBJS = qt-ui/maintab.o qt-ui/mainwindow.o qt-ui/plotareascene.o
|
|
|
|
|
2013-04-08 03:20:25 +00:00
|
|
|
OBJS = main.o dive.o time.o profile.o info.o equipment.o divelist.o divelist-gtk.o deco.o \
|
|
|
|
planner.o planner-gtk.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-04-01 10:51:49 +00:00
|
|
|
qt-gui.o statistics.o file.o cochran.o device.o download-dialog.o prefs.o \
|
2013-04-07 22:20:43 +00:00
|
|
|
webservice.o sha1.o $(GPSOBJ) $(OSSUPPORT).o $(RESFILE) $(QTOBJS)
|
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-04-01 09:25:15 +00:00
|
|
|
$(CXX) $(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 \
|
|
|
|
$(INSTALL) -d -m 755 $(DATADIR)/subsurface; \
|
|
|
|
$(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; \
|
|
|
|
$(INSTALL) -m 644 $$LOC/subsurface.mo $(prefix)/$$LOC/subsurface.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/
|
|
|
|
$(INSTALL) $(MACOSXFILES)/Subsurface.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; \
|
|
|
|
$(INSTALL) $$LOC/subsurface.mo $(MACOSXINSTALL)/Contents/Resources/$$LOC/subsurface.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/
|
|
|
|
$(INSTALL) $(MACOSXFILES)/Subsurface.icns $(MACOSXSTAGING)/Contents/Resources/
|
|
|
|
for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \
|
|
|
|
$(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources/$$LOC; \
|
|
|
|
$(INSTALL) $$LOC/subsurface.mo $(MACOSXSTAGING)/Contents/Resources/$$LOC/subsurface.mo; \
|
|
|
|
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
|
2012-10-17 06:55:35 +00:00
|
|
|
$(GTK_MAC_BUNDLER) packaging/macosx/subsurface.bundle
|
2012-10-17 04:24:02 +00:00
|
|
|
|
2013-02-27 11:12:01 +00:00
|
|
|
sign-macosx-bundle: all
|
2013-02-14 17:19:28 +00:00
|
|
|
codesign -s "3A8CE62A483083EDEA5581A61E770EC1FA8BECE8" /Applications/Subsurface.app/Contents/MacOS/subsurface-bin
|
|
|
|
|
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; \
|
|
|
|
$(INSTALL) $$LOC/subsurface.mo $(WINDOWSSTAGING)/$$LOC/subsurface.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:
|
2012-10-19 07:50:14 +00:00
|
|
|
xgettext -o po/subsurface-new.pot -s -k_ -kN_ --keyword=C_:1c,2 --add-comments="++GETTEXT" *.c
|
2013-02-25 16:23:54 +00:00
|
|
|
tx push -s
|
|
|
|
tx pull -af
|
2013-02-09 18:52:01 +00:00
|
|
|
|
2013-04-01 09:25:15 +00:00
|
|
|
EXTRA_FLAGS = $(QTCXXFLAGS) $(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-04-01 09:25:15 +00:00
|
|
|
MOCFLAGS = $(filter -I%, $(CXXFLAGS) $(EXTRA_FLAGS)) $(filter -D%, $(CXXFLAGS) $(EXTRA_FLAGS))
|
|
|
|
|
2013-01-31 02:48:59 +00:00
|
|
|
%.o: %.c
|
|
|
|
@echo ' CC' $<
|
2013-04-07 22:20:43 +00:00
|
|
|
@mkdir -p .dep .dep/qt-ui
|
2013-01-31 02:48:59 +00:00
|
|
|
@$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
|
2011-11-24 06:56:57 +00:00
|
|
|
|
2013-04-01 09:25:15 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
@echo ' CXX' $<
|
2013-04-07 22:20:43 +00:00
|
|
|
@mkdir -p .dep .dep/qt-ui
|
2013-04-01 09:25:15 +00:00
|
|
|
@$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
|
|
|
|
|
2013-04-01 20:08:13 +00:00
|
|
|
# This rule is for running the moc on QObject subclasses defined in the .cpp
|
|
|
|
# files; remember to #include "<file>.moc" at the end of the .cpp file, or
|
|
|
|
# you'll get linker errors ("undefined vtable for...")
|
|
|
|
# To activate this rule, you need another rule on the .o file, like:
|
|
|
|
# file.o: file.moc
|
2013-04-07 22:20:43 +00:00
|
|
|
|
|
|
|
qt-ui/%.moc: qt-ui/%.h
|
|
|
|
@echo ' MOC' $<
|
|
|
|
@$(MOC) -i $(MOCFLAGS) $< -o $@
|
|
|
|
|
|
|
|
# this is just here for qt-gui.cpp
|
|
|
|
# should be removed once all the Qt UI code has been moved into qt-ui
|
|
|
|
|
2013-04-01 20:08:13 +00:00
|
|
|
%.moc: %.cpp
|
2013-04-01 09:25:15 +00:00
|
|
|
@echo ' MOC' $<
|
|
|
|
@$(MOC) -i $(MOCFLAGS) $< -o $@
|
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
# This creates the ui headers.
|
|
|
|
# To activate this rule, you need to add the ui_*.h file to the .o file:
|
|
|
|
# file.o: ui_file.h
|
2013-04-01 10:57:51 +00:00
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
qt-ui/ui_%.h: qt-ui/%.ui
|
2013-04-01 09:25:15 +00:00
|
|
|
@echo ' UIC' $<
|
|
|
|
@$(UIC) $< -o $@
|
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
qt-gui.o: qt-gui.moc
|
|
|
|
|
|
|
|
qt-ui/maintab.o: qt-ui/maintab.moc qt-ui/ui_maintab.h
|
|
|
|
|
|
|
|
qt-ui/mainwindow.o: qt-ui/mainwindow.moc qt-ui/ui_mainwindow.h
|
|
|
|
|
2012-10-19 19:53:08 +00:00
|
|
|
share/locale/%.UTF-8/LC_MESSAGES/subsurface.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
|
|
|
|
# convert -colorspace RGB -transparent white -resize 256x256 subsurface-icon.svg subsurface-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
|
|
|
|
@echo ' gdk-pixbuf-csource' $<
|
2013-02-02 11:45:05 +00:00
|
|
|
@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-02-26 17:24:02 +00:00
|
|
|
rm -f $(OBJS) *~ $(NAME) $(NAME).exe po/*~ po/subsurface-new.pot \
|
2013-04-07 22:20:43 +00:00
|
|
|
$(VERSION_FILE) qt-ui/*.moc qt-ui/ui_*.h
|
2013-01-31 02:48:59 +00:00
|
|
|
rm -rf share .dep
|
|
|
|
|
|
|
|
-include $(DEPS)
|