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-14 01:11:57 +00:00
|
|
|
CXXFLAGS=-Wall -g $(CLCFLAGS) -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)
|
2013-04-22 23:00:27 +00:00
|
|
|
QT_MODULES = Qt5Widgets Qt5Svg
|
2013-04-01 09:25:15 +00:00
|
|
|
QT_CORE = Qt5Core
|
|
|
|
else
|
2013-04-22 23:00:27 +00:00
|
|
|
QT_MODULES = QtGui QtSvg
|
2013-04-01 09:25:15 +00:00
|
|
|
QT_CORE = QtCore
|
|
|
|
endif
|
2013-04-14 03:44:02 +00:00
|
|
|
|
|
|
|
# we need GLIB2CFLAGS for gettext
|
|
|
|
QTCXXFLAGS = $(shell $(PKGCONFIG) --cflags $(QT_MODULES)) $(GLIB2CFLAGS)
|
2013-04-01 09:25:15 +00:00
|
|
|
LIBQT = $(shell $(PKGCONFIG) --libs $(QT_MODULES))
|
2013-04-23 05:46:38 +00:00
|
|
|
ifneq ($(filter reduce_relocations, $(shell $(PKGCONFIG) --variable qt_config $(QT_CORE))), )
|
|
|
|
QTCXXFLAGS += -fPIE
|
|
|
|
endif
|
2013-04-01 09:25:15 +00:00
|
|
|
|
2011-11-25 06:32:10 +00:00
|
|
|
LIBGTK = $(shell $(PKGCONFIG) --libs gtk+-2.0 glib-2.0)
|
2013-04-23 05:46:38 +00:00
|
|
|
ifneq (,$(filter $(UNAME),linux kfreebsd gnu))
|
|
|
|
LIBGCONF2 = $(shell $(PKGCONFIG) --libs gconf-2.0)
|
|
|
|
GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0)
|
|
|
|
else ifeq ($(UNAME), darwin)
|
|
|
|
LIBGTK += $(shell $(PKGCONFIG) --libs gtk-mac-integration) -framework CoreFoundation -framework CoreServices
|
|
|
|
GTKCFLAGS += $(shell $(PKGCONFIG) --cflags gtk-mac-integration)
|
|
|
|
GTK_MAC_BUNDLER = ~/.local/bin/gtk-mac-bundler
|
|
|
|
endif
|
|
|
|
|
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)
|
2013-04-23 06:09:23 +00:00
|
|
|
XSLCFLAGS = $(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)
|
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)
|
2013-04-23 06:09:23 +00:00
|
|
|
ZIPFLAGS = $(strip $(shell $(PKGCONFIG) --cflags libzip 2> /dev/null))
|
2012-01-27 01:43:33 +00:00
|
|
|
|
2013-03-05 05:10:39 +00:00
|
|
|
LIBSQLITE3 = $(shell $(PKGCONFIG) --libs sqlite3 2> /dev/null)
|
2013-04-23 06:09:23 +00:00
|
|
|
SQLITE3FLAGS = $(strip $(shell $(PKGCONFIG) --cflags sqlite3))
|
2013-03-05 05:10:39 +00:00
|
|
|
|
2013-04-23 06:13:10 +00:00
|
|
|
QTOBJS = qt-ui/maintab.o qt-ui/mainwindow.o qt-ui/plotareascene.o qt-ui/divelistview.o \
|
|
|
|
qt-ui/addcylinderdialog.o qt-ui/models.o qt-ui/starwidget.o
|
|
|
|
|
|
|
|
GTKOBJS = info-gtk.o divelist-gtk.o planner-gtk.o statistics-gtk.o
|
|
|
|
|
|
|
|
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 \
|
|
|
|
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o uemis-downloader.o \
|
|
|
|
qt-gui.o statistics.o file.o cochran.o device.o download-dialog.o prefs.o \
|
|
|
|
webservice.o sha1.o $(RESFILE) $(QTOBJS) $(GTKOBJS)
|
|
|
|
|
2013-03-11 16:44:51 +00:00
|
|
|
ifneq (,$(filter $(UNAME),linux kfreebsd gnu))
|
2013-04-23 06:13:10 +00:00
|
|
|
OBJS += linux.o
|
2011-11-25 06:32:10 +00:00
|
|
|
else ifeq ($(UNAME), darwin)
|
2013-04-23 06:13:10 +00:00
|
|
|
OBJS += macos.o
|
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
|
|
|
|
LDFLAGS += -headerpad_max_install_names -sectcreate __TEXT __info_plist $(INFOPLIST)
|
2011-11-24 06:56:57 +00:00
|
|
|
else
|
2013-04-23 06:13:10 +00:00
|
|
|
OBSJ += windows.o
|
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
|
|
|
|
|
|
|
|
|
2013-04-13 13:17:59 +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))
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
# Add files to the following variables if the auto-detection based on the
|
|
|
|
# filename fails
|
|
|
|
OBJS_NEEDING_MOC =
|
|
|
|
OBJS_NEEDING_UIC =
|
|
|
|
HEADERS_NEEDING_MOC =
|
|
|
|
|
2013-04-23 06:18:36 +00:00
|
|
|
MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/subsurface.mo))
|
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
# Add the objects for the header files which define QObject subclasses
|
|
|
|
HEADERS_NEEDING_MOC += $(shell grep -l -s 'Q_OBJECT' $(OBJS:.o=.h))
|
|
|
|
MOC_OBJS = $(HEADERS_NEEDING_MOC:.h=.moc.o)
|
2013-01-31 02:48:59 +00:00
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
ALL_OBJS = $(OBJS) $(MOC_OBJS)
|
|
|
|
|
|
|
|
DEPS = $(wildcard .dep/*.dep)
|
2013-02-27 11:12:01 +00:00
|
|
|
|
|
|
|
all: $(NAME)
|
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
$(NAME): gen_version_file $(ALL_OBJS) $(MSGOBJS) $(INFOPLIST)
|
|
|
|
$(CXX) $(LDFLAGS) -o $(NAME) $(ALL_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:
|
2013-04-14 13:44:29 +00:00
|
|
|
xgettext -o po/subsurface-new.pot -s -k_ -kN_ -ktr --keyword=C_:1c,2 --add-comments="++GETTEXT" *.c qt-ui/*.cpp
|
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-04-23 06:09:23 +00:00
|
|
|
$(LIBDIVECOMPUTERCFLAGS) \
|
|
|
|
$(LIBSOUPCFLAGS) $(GCONF2CFLAGS)
|
|
|
|
|
|
|
|
ifneq ($(SQLITE3FLAGS),)
|
|
|
|
EXTRA_FLAGS += -DSQLITE3 $(SQLITE3FLAGS)
|
|
|
|
endif
|
|
|
|
ifneq ($(ZIPFLAGS),)
|
|
|
|
EXTRA_FLAGS += -DLIBZIP $(ZIPFLAGS)
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(LIBXSLT)),)
|
|
|
|
EXTRA_FLAGS += -DXSLT='"$(XSLTDIR)"' $(XSLCFLAGS)
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(LIBOSMGPSMAP)),)
|
|
|
|
OBJS += gps.o
|
|
|
|
EXTRA_FLAGS += -DHAVE_OSM_GPS_MAP $(OSMGPSMAPFLAGS)
|
|
|
|
endif
|
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-09 15:34:26 +00:00
|
|
|
# Detect which files require the moc or uic tools to be run
|
|
|
|
CPP_NEEDING_MOC = $(shell grep -l -s '^\#include \".*\.moc\"' $(OBJS:.o=.cpp))
|
|
|
|
OBJS_NEEDING_MOC += $(CPP_NEEDING_MOC:.cpp=.o)
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
CPP_NEEDING_UIC = $(shell grep -l -s '^\#include \"ui_.*\.h\"' $(OBJS:.o=.cpp))
|
|
|
|
OBJS_NEEDING_UIC += $(CPP_NEEDING_UIC:.cpp=.o)
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
# This rule is for running the moc on QObject subclasses defined in the .h
|
|
|
|
# files.
|
|
|
|
%.moc.cpp: %.h
|
|
|
|
@echo ' MOC' $<
|
|
|
|
@$(MOC) $(MOCFLAGS) $< -o $@
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-04-09 15:34:26 +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...")
|
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.
|
2013-04-09 15:34:26 +00:00
|
|
|
ui_%.h: %.ui
|
2013-04-01 09:25:15 +00:00
|
|
|
@echo ' UIC' $<
|
|
|
|
@$(UIC) $< -o $@
|
|
|
|
|
2013-04-09 15:34:26 +00:00
|
|
|
$(OBJS_NEEDING_MOC): %.o: %.moc
|
|
|
|
$(OBJS_NEEDING_UIC): qt-ui/%.o: qt-ui/ui_%.h
|
2013-04-07 22:20:43 +00:00
|
|
|
|
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-04-09 15:34:26 +00:00
|
|
|
rm -f $(ALL_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)
|