diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-10-06 18:07:20 -0700 |
---|---|---|
committer | Thiago Macieira <thiago@macieira.org> | 2013-10-08 23:29:43 -0700 |
commit | 1e7db5f77f01a0f091969c036b007165af35a509 (patch) | |
tree | ffd27da20ae650d700c559897ee223dec85cc54f | |
parent | 67e49d6480126968a1d87a12ae6e967b861e8909 (diff) | |
download | subsurface-1e7db5f77f01a0f091969c036b007165af35a509.tar.gz |
Remove the old buildsystem
Signed-off-by: Thiago Macieira <thiago@macieira.org>
-rw-r--r-- | .gitignore | 15 | ||||
-rw-r--r-- | Configure.mk | 183 | ||||
-rw-r--r-- | Makefile | 165 | ||||
-rw-r--r-- | Rules.mk | 289 |
4 files changed, 1 insertions, 651 deletions
diff --git a/.gitignore b/.gitignore index 5c1eae4b0..085323a37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,19 +3,14 @@ *.rej *.exe *.dmg -*.moc -*.moc.cpp *.patch -*.ui.h *.xml version.h !dives/*.xml *~ po/*.mo -qt-ui/ui_*.h /subsurface /*.tar.gz -.dep/ share/ Documentation/docbook-xsl.css Documentation/user-manual.html @@ -23,19 +18,11 @@ Documentation/user-manual.pdf Documentation/user-manual.text packaging/windows/subsurface.nsi packaging/macos/Info.plist -config.cache -*.qrc.cpp -ui_* -/subsurface.config -/subsurface.creator -/subsurface.creator.user -/subsurface.files -/subsurface.includes *.kdev4 callgrind.out.* - .rcc .moc .uic .obj +Makefile subsurface.pro.user* diff --git a/Configure.mk b/Configure.mk deleted file mode 100644 index 9e9a2ba0e..000000000 --- a/Configure.mk +++ /dev/null @@ -1,183 +0,0 @@ -# -*- Makefile -*- -# This file contains the detection rules -all: - -PKGCONFIG=pkg-config -XML2CONFIG=xml2-config -XSLCONFIG=xslt-config -QMAKE=qmake -MOC=moc -UIC=uic -TAR=tar - -CONFIGFILE = config.cache -ifeq ($(CONFIGURING),1) - -# Detect the target system -# Ask the compiler what OS it's producing files for -UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win|gnu|kfreebsd") - -# find libdivecomputer -# 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 -# override by simply setting it here -# -ifeq ($(CC), i686-w64-mingw32-gcc) -# ok, we are cross building for Windows - LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer) - LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer) - RESFILE = packaging/windows/subsurface.res - LDFLAGS += -Wl,-subsystem,windows - LIBWINSOCK = -lwsock32 -else ifeq ($(UNAME), darwin) - LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer) - LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer) -else ifneq ($(LIBDCDEVEL),) - LIBDIVECOMPUTERDIR = ../libdivecomputer - LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include - LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/src/.libs/libdivecomputer.a -else ifeq ($(shell $(PKGCONFIG) --exists libdivecomputer; echo $$?),0) - LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer) - LIBDIVECOMPUTERARCHIVE = $(shell $(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) -libdc-usr64 := $(wildcard /usr/lib64/libdivecomputer.a) - -ifneq ($(strip $(libdc-local)),) - LIBDIVECOMPUTERDIR = /usr/local - LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include - LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a -else ifneq ($(strip $(libdc-local64)),) - LIBDIVECOMPUTERDIR = /usr/local - LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include - LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a -else ifneq ($(strip $(libdc-usr)),) - LIBDIVECOMPUTERDIR = /usr - LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include - LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a -else ifneq ($(strip $(libdc-usr64)),) - LIBDIVECOMPUTERDIR = /usr - LIBDIVECOMPUTERINCLUDES = -I$(LIBDIVECOMPUTERDIR)/include - LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib64/libdivecomputer.a -else -$(error Cannot find libdivecomputer - please edit Makefile) -endif -endif - -# 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. -LIBUSB = $(shell $(PKGCONFIG) --libs libusb-1.0 2> /dev/null) - -# Find qmake. Rules are: -# - use qmake if it is in $PATH -# [qmake -query QT_VERSION will fail if it's Qt 3's qmake] -# - if that fails, try qmake-qt4 -# - if that fails, print an error -# We specifically do not search for qmake-qt5 since that is not supposed -# to exist. -QMAKE = $(shell { qmake -query QT_VERSION >/dev/null 2>&1 && echo qmake; } || \ - { qmake-qt4 -v >/dev/null 2>&1 && echo qmake-qt4; }) -ifeq ($(strip $(QMAKE)),) -$(error Could not find qmake or qmake-qt4 in $$PATH or they failed) -endif - -# 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 Qt5Svg -# QT_CORE = Qt5Core -# QTBINDIR = $(shell $(QMAKE) -query QT_HOST_BINS) -# # Tool paths are not stored in .pc files in Qt 5.0 -# MOC = $(QTBINDIR)/moc -# UIC = $(QTBINDIR)/uic -# RCC = $(QTBINDIR)/rcc -# if qmake is qt5, try to get the qt4 one. - QMAKE = { qmake-qt4 -v >/dev/null 2>&1 && echo qmake-qt4; } -#else -endif - -ifeq ($(strip $(QMAKE)),) -$(error Could not find qmake or qmake-qt4 in $$PATH for the Qt4 version they failed) -endif - - QT_MODULES = QtGui QtSvg QtNetwork QtWebKit - QT_CORE = QtCore - MOC = $(shell $(PKGCONFIG) --variable=moc_location QtCore) - UIC = $(shell $(PKGCONFIG) --variable=uic_location QtGui) - RCC = $(shell $(PKGCONFIG) --variable=rcc_location QtGui) -#endif - -QTCXXFLAGS = $(shell $(PKGCONFIG) --cflags $(QT_MODULES)) -LIBQT = $(shell $(PKGCONFIG) --libs $(QT_MODULES)) -ifneq ($(filter reduce_relocations, $(shell $(PKGCONFIG) --variable qt_config $(QT_CORE))), ) - QTCXXFLAGS += -fPIE -endif - -ifeq ($(UNAME), darwin) - LDFLAGS += -framework CoreFoundation -framework CoreServices -endif - -LIBDIVECOMPUTERCFLAGS = $(LIBDIVECOMPUTERINCLUDES) -LIBDIVECOMPUTER = $(LIBDIVECOMPUTERARCHIVE) $(LIBUSB) - -LIBXML2 = $(shell $(XML2CONFIG) --libs) -LIBXSLT = $(shell $(XSLCONFIG) --libs) -XML2CFLAGS = $(shell $(XML2CONFIG) --cflags) -XSLCFLAGS = $(shell $(XSLCONFIG) --cflags) - -LIBZIP = $(shell $(PKGCONFIG) --libs libzip 2> /dev/null) -ZIPFLAGS = $(strip $(shell $(PKGCONFIG) --cflags libzip 2> /dev/null)) - -LIBSQLITE3 = $(shell $(PKGCONFIG) --libs sqlite3 2> /dev/null) -SQLITE3FLAGS = $(strip $(shell $(PKGCONFIG) --cflags sqlite3)) - -# Before Marble 4.9, the GeoDataTreeModel.h header wasn't installed -# Check if it's present by trying to compile -MARBLEFLAGS = $(shell $(CXX) $(QTCXXFLAGS) -E -include marble/GeoDataTreeModel.h -xc++ /dev/null > /dev/null 2>&1 || echo " -DINCOMPLETE_MARBLE") -MARBLELIBS = -lmarblewidget - -# Write the configure file -all: configure -configure $(CONFIGURE): Configure.mk - @echo "\ - CONFIGURED = 1\\\ - UNAME = $(UNAME)\\\ - LIBDIVECOMPUTERDIR = $(LIBDIVECOMPUTERDIR)\\\ - LIBDIVECOMPUTERCFLAGS = $(LIBDIVECOMPUTERCFLAGS)\\\ - LIBDIVECOMPUTER = $(LIBDIVECOMPUTER)\\\ - LIBWINSOCK = $(LIBWINSOCK)\\\ - LDFLAGS = $(LDFLAGS)\\\ - RESFILE = $(RESFILE)\\\ - LIBQT = $(LIBQT)\\\ - QTCXXFLAGS = $(QTCXXFLAGS)\\\ - MOC = $(MOC)\\\ - UIC = $(UIC)\\\ - RCC = $(RCC)\\\ - LIBXML2 = $(LIBXML2)\\\ - LIBXSLT = $(LIBXSLT)\\\ - XML2CFLAGS = $(XML2CFLAGS)\\\ - XSLCFLAGS = $(XSLCFLAGS)\\\ - LIBZIP = $(LIBZIP)\\\ - ZIPFLAGS = $(ZIPFLAGS)\\\ - LIBSQLITE3 = $(LIBSQLITE3)\\\ - SQLITE3FLAGS = $(SQLITE3FLAGS)\\\ - MARBLEFLAGS = $(MARBLEFLAGS)\\\ - MARBLELIBS = $(MARBLELIBS)\\\ - " | tr '\\' '\n' > $(CONFIGFILE) - -else -configure $(CONFIGFILE): Configure.mk - @test -e $(CONFIGFILE) && echo Reconfiguring.. || echo Configuring... - @$(MAKE) CONFIGURING=1 configure - @echo Done - --include $(CONFIGFILE) -endif - -.PHONY: configure all diff --git a/Makefile b/Makefile deleted file mode 100644 index 657309918..000000000 --- a/Makefile +++ /dev/null @@ -1,165 +0,0 @@ -NAME = subsurface -CAPITALIZED_NAME = Subsurface -TARGET = $(NAME) - -include Configure.mk -VERSION=3.1 - -CC=gcc -CFLAGS=-Wall -Wno-pointer-sign -g $(CLCFLAGS) -DGSEAL_ENABLE -CXX=g++ -CXXFLAGS=-Wall -g $(CLCXXFLAGS) $(MARBLEFLAGS) -INSTALL=install - -# these locations seem to work for SuSE and Fedora -# prefix = $(HOME) -prefix = $(DESTDIR)/usr -BINDIR = $(prefix)/bin -DATADIR = $(prefix)/share -DOCDIR = $(DATADIR)/doc/$(NAME) -DESKTOPDIR = $(DATADIR)/applications -ICONPATH = $(DATADIR)/icons/hicolor -ICONDIR = $(ICONPATH)/scalable/apps -MANDIR = $(DATADIR)/man/man1 -XSLTDIR = $(DATADIR)/$(NAME)/xslt -MARBLEDIR = marbledata/maps/earth/googlesat - -ICONFILE = $(NAME)-icon.svg -DESKTOPFILE = $(NAME).desktop -MANFILES = $(NAME).1 -XSLTFILES = xslt/*.xslt xslt/*.xsl - -EXTRA_FLAGS = $(QTCXXFLAGS) $(GLIB2CFLAGS) $(XML2CFLAGS) \ - $(LIBDIVECOMPUTERCFLAGS) \ - $(LIBSOUPCFLAGS) -I. -DQT_NO_STL - -HEADERS = \ - qt-ui/divelistview.h \ - qt-ui/maintab.h \ - qt-ui/mainwindow.h \ - qt-ui/models.h \ - qt-ui/plotareascene.h \ - qt-ui/starwidget.h \ - qt-ui/modeldelegates.h \ - qt-ui/profilegraphics.h \ - qt-ui/globe.h \ - qt-ui/kmessagewidget.h \ - qt-ui/downloadfromdivecomputer.h \ - qt-ui/preferences.h \ - qt-ui/simplewidgets.h \ - qt-ui/subsurfacewebservices.h \ - qt-ui/divecomputermanagementdialog.h \ - qt-ui/diveplanner.h \ - qt-ui/about.h \ - qt-ui/graphicsview-common.h \ - qt-ui/printdialog.h \ - qt-ui/printoptions.h \ - qt-ui/printlayout.h \ - qt-ui/completionmodels.h \ - qt-ui/tableview.h - - -SOURCES = \ - deco.c \ - device.c \ - dive.c \ - divelist.c \ - equipment.c \ - file.c \ - parse-xml.c \ - planner.c \ - subsurfacestartup.c \ - profile.c \ - save-xml.c \ - sha1.c \ - statistics.c \ - time.c \ - uemis.c \ - uemis-downloader.c \ - libdivecomputer.c \ - gettextfromc.cpp \ - qthelper.cpp \ - qt-ui/simplewidgets.cpp \ - qt-ui/tableview.cpp \ - qt-ui/mainwindow.cpp \ - qt-ui/models.cpp \ - qt-ui/plotareascene.cpp \ - qt-ui/starwidget.cpp \ - qt-ui/modeldelegates.cpp \ - qt-ui/profilegraphics.cpp \ - qt-ui/globe.cpp \ - qt-ui/kmessagewidget.cpp \ - qt-ui/downloadfromdivecomputer.cpp \ - qt-ui/preferences.cpp \ - qt-ui/subsurfacewebservices.cpp \ - qt-ui/divecomputermanagementdialog.cpp \ - qt-ui/diveplanner.cpp \ - qt-ui/divelistview.cpp \ - qt-ui/about.cpp \ - qt-ui/graphicsview-common.cpp \ - qt-ui/printdialog.cpp \ - qt-ui/printoptions.cpp \ - qt-ui/printlayout.cpp \ - qt-ui/completionmodels.cpp \ - qt-ui/maintab.cpp \ - qt-gui.cpp \ - main.cpp \ - $(RESFILE) - -FORMS = \ - qt-ui/about.ui \ - qt-ui/divecomputermanagementdialog.ui \ - qt-ui/diveplanner.ui \ - qt-ui/downloadfromdivecomputer.ui \ - qt-ui/maintab.ui \ - qt-ui/mainwindow.ui \ - qt-ui/preferences.ui \ - qt-ui/printoptions.ui \ - qt-ui/renumber.ui \ - qt-ui/subsurfacewebservices.ui \ - qt-ui/tableview.ui - -RESOURCES = $(NAME).qrc - -ifneq ($(SQLITE3FLAGS),) - EXTRA_FLAGS += -DSQLITE3 $(SQLITE3FLAGS) -endif -ifneq ($(ZIPFLAGS),) - EXTRA_FLAGS += -DLIBZIP $(ZIPFLAGS) -endif -ifneq ($(strip $(LIBXSLT)),) - EXTRA_FLAGS += -DXSLT='"$(XSLTDIR)"' $(XSLCFLAGS) -endif - -ifneq (,$(filter $(UNAME),linux kfreebsd gnu)) - SOURCES += linux.c -else ifeq ($(UNAME), darwin) - SOURCES += macos.c - MACOSXINSTALL = /Applications/$(CAPITALIZED_NAME).app - MACOSXFILES = packaging/macosx - MACOSXSTAGING = $(MACOSXFILES)/$(CAPITALIZED_NAME).app - INFOPLIST = $(MACOSXFILES)/Info.plist - INFOPLISTINPUT = $(INFOPLIST).in - LDFLAGS += -headerpad_max_install_names -else - SOURCES += windows.c - WINDOWSSTAGING = ./packaging/windows - WINMSGDIRS=$(addprefix share/locale/,$(shell ls po/*.po | sed -e 's/po\/\(..\)_.*/\1\/LC_MESSAGES/')) - NSIINPUTFILE = $(WINDOWSSTAGING)/$(NAME).nsi.in - NSIFILE = $(WINDOWSSTAGING)/$(NAME).nsi - MAKENSIS = makensis - XSLTDIR = .\\xslt - TARGET = $(NAME).exe -endif - -LIBS = $(LIBQT) $(LIBXML2) $(LIBXSLT) $(LIBSQLITE3) $(LIBDIVECOMPUTER) \ - $(EXTRALIBS) $(LIBZIP) -lpthread -lm $(LIBSOUP) $(LIBWINSOCK) $(MARBLELIBS) - -MSGLANGS=$(notdir $(wildcard po/*.po)) - -# Add files to the following variables if the auto-detection based on the -# filename fails -OBJS_NEEDING_MOC = -HEADERS_NEEDING_MOC = - -include Rules.mk diff --git a/Rules.mk b/Rules.mk deleted file mode 100644 index d6ab2584c..000000000 --- a/Rules.mk +++ /dev/null @@ -1,289 +0,0 @@ -# -*- Makefile -*- -# Rules for building and creating the version file - -VERSION_FILE = version.h -# There's only one line in $(VERSION_FILE); use the shell builtin `read' -STORED_VERSION_STRING = \ - $(subst ",,$(shell [ ! -r $(VERSION_FILE) ] || \ - read ignore ignore v <$(VERSION_FILE) && echo $$v)) -#" workaround editor syntax highlighting quirk - -GET_VERSION = ./scripts/get-version -VERSION_STRING := $(shell $(GET_VERSION) linux || echo "v$(VERSION)") -# Mac Info.plist style with three numbers 1.2.3 -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") - -MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/$(NAME).mo)) - -ifeq ($(V),1) - PRETTYECHO=true - COMPILE_PREFIX= -else - PRETTYECHO=echo - COMPILE_PREFIX=@ -endif - -C_SOURCES = $(filter %.c, $(SOURCES)) -CXX_SOURCES = $(filter %.cpp, $(SOURCES)) $(RESOURCES:.qrc=.qrc.cpp) -OTHER_SOURCES = $(filter-out %.c %.cpp, $(SOURCES)) -OBJS = $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o) $(OTHER_SOURCES) - -# Add the objects for the header files which define QObject subclasses -HEADERS_NEEDING_MOC += $(shell grep -l -s 'Q_OBJECT' $(HEADERS)) -MOC_OBJS = $(HEADERS_NEEDING_MOC:.h=.moc.o) - -ALL_OBJS = $(OBJS) $(MOC_OBJS) - -# handling of uic -UIC_HEADERS = $(patsubst qt-ui/%.ui, .uic/ui_%.h, $(FORMS)) -# Needs to exist before we add path -$(shell mkdir -p .uic) -vpath ui_%.h .uic - -# Files for using Qt Creator -CREATOR_FILES = $(NAME).config $(NAME).creator $(NAME).files $(NAME).includes - -all: $(TARGET) doc - -$(TARGET): gen_version_file $(UIC_HEADERS) $(ALL_OBJS) $(INFOPLIST) - @$(PRETTYECHO) ' LINK' $(TARGET) - $(COMPILE_PREFIX)$(CXX) $(LDFLAGS) -o $(TARGET) $(ALL_OBJS) $(LIBS) - -gen_version_file $(VERSION_FILE): -ifneq ($(STORED_VERSION_STRING),$(VERSION_STRING)) - $(info updating $(VERSION_FILE) to $(VERSION_STRING)) - @echo \#define VERSION_STRING \"$(VERSION_STRING)\" >$(VERSION_FILE) -endif - -install: all - $(INSTALL) -d -m 755 $(BINDIR) - $(INSTALL) $(NAME) $(BINDIR) - $(INSTALL) -d -m 755 $(DESKTOPDIR) - $(INSTALL) $(DESKTOPFILE) $(DESKTOPDIR) - $(INSTALL) -d -m 755 $(ICONDIR) - $(INSTALL) -m 644 $(ICONFILE) $(ICONDIR) - @-if test -z "$(DESTDIR)"; then \ - $(gtk_update_icon_cache); \ - fi - $(INSTALL) -d -m 755 $(MANDIR) - $(INSTALL) -m 644 $(MANFILES) $(MANDIR) - @-if test ! -z "$(XSLT)"; then \ - $(INSTALL) -d -m 755 $(DATADIR)/$(NAME); \ - $(INSTALL) -d -m 755 $(XSLTDIR); \ - $(INSTALL) -m 644 $(XSLTFILES) $(XSLTDIR); \ - fi - @-if test ! -z "$(MARBLEDIR)"; then \ - $(INSTALL) -d -m 755 $(DATADIR)/$(NAME)/$(MARBLEDIR); \ - $(TAR) cf - $(MARBLEDIR) | ( cd $(DATADIR)/$(NAME); $(TAR) xf - ); \ - fi - for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \ - $(INSTALL) -d $(prefix)/$$LOC; \ - $(INSTALL) -m 644 $$LOC/$(NAME).mo $(prefix)/$$LOC/$(NAME).mo; \ - done - $(INSTALL) -d -m 755 $(DOCDIR) - $(INSTALL) -m 644 Documentation/user-manual.html $(DOCDIR) - for IMG in $(wildcard Documentation/images/*); do \ - $(INSTALL) -m 644 $$IMG $(DOCDIR)/images; \ - done - - -install-macosx: all - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/MacOS - $(INSTALL) $(NAME) $(MACOSXINSTALL)/Contents/MacOS/$(NAME)-bin - $(INSTALL) $(MACOSXFILES)/$(NAME).sh $(MACOSXINSTALL)/Contents/MacOS/$(NAME) - $(INSTALL) $(MACOSXFILES)/PkgInfo $(MACOSXINSTALL)/Contents/ - $(INSTALL) $(MACOSXFILES)/Info.plist $(MACOSXINSTALL)/Contents/ - $(INSTALL) $(ICONFILE) $(MACOSXINSTALL)/Contents/Resources/ - $(INSTALL) $(MACOSXFILES)/$(CAPITALIZED_NAME).icns $(MACOSXINSTALL)/Contents/Resources/ - @-if test ! -z "$(MARBLEDIR)"; then \ - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources/share/$(MARBLEDIR); \ - $(TAR) cf - $(MARBLEDIR) | ( cd $(MACOSXINSTALL)/Contents/Resources/share; $(TAR) xf - ); \ - fi - for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \ - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources/$$LOC; \ - $(INSTALL) $$LOC/$(NAME).mo $(MACOSXINSTALL)/Contents/Resources/$$LOC/$(NAME).mo; \ - done - @-if test ! -z "$(XSLT)"; then \ - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources/share/xslt; \ - $(INSTALL) -m 644 $(XSLTFILES) $(MACOSXINSTALL)/Contents/Resources/share/xslt/; \ - fi - $(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/resources/share/doc/$(NAME) - $(INSTALL) -m 644 Documentation/user-manual.html $(MACOSXINSTALL)/Contents/Resources/share/doc/$(NAME) - for IMG in $(wildcard Documentation/images/*); do \ - $(INSTALL) -m 644 $$IMG $(MACOSXINSTALL)/Contents/Resources/share/doc/$(NAME)/images; \ - done - - -create-macosx-bundle: all - $(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)/$(CAPITALIZED_NAME).icns $(MACOSXSTAGING)/Contents/Resources/ - for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \ - $(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources/$$LOC; \ - $(INSTALL) $$LOC/$(NAME).mo $(MACOSXSTAGING)/Contents/Resources/$$LOC/$(NAME).mo; \ - done - @-if test ! -z "$(XSLT)"; then \ - $(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/Resources/xslt; \ - $(INSTALL) -m 644 $(XSLTFILES) $(MACOSXSTAGING)/Contents/Resources/xslt/; \ - fi - $(INSTALL) -d -m 755 $(MACOSXSTAGING)/Contents/resources/share/doc/$(NAME) - $(INSTALL) -m 644 Documentation/user-manual.html $(MACOSXSTAGING)/Contents/Resources/share/doc/$(NAME) - for IMG in $(wildcard Documentation/images/*); do \ - $(INSTALL) -m 644 $$IMG $(MACOSXSTAGING)/Contents/Resources/share/doc/$(NAME)/images; \ - done - $(GTK_MAC_BUNDLER) packaging/macosx/$(NAME).bundle - -sign-macosx-bundle: all - codesign -s "3A8CE62A483083EDEA5581A61E770EC1FA8BECE8" /Applications/$(CAPITALIZED_NAME).app/Contents/MacOS/$(NAME)-bin - -$(RESFILE): packaging/windows/subsurface.rc - @$(PRETTYECHO) ' WINDRES' $< - @i686-w64-mingw32-windres -O coff -i $< -o $@ - -install-cross-windows: all - $(INSTALL) -d -m 755 $(WINDOWSSTAGING)/share/locale - for MSG in $(WINMSGDIRS); do\ - $(INSTALL) -d -m 755 $(WINDOWSSTAGING)/$$MSG;\ - $(INSTALL) $(CROSS_PATH)/$$MSG/* $(WINDOWSSTAGING)/$$MSG;\ - done - for LOC in $(wildcard share/locale/*/LC_MESSAGES); do \ - $(INSTALL) -d -m 755 $(WINDOWSSTAGING)/$$LOC; \ - $(INSTALL) $$LOC/$(NAME).mo $(WINDOWSSTAGING)/$$LOC/$(NAME).mo; \ - done - $(INSTALL) -d -m 755 $(WINDOWSSTAGING)/share/doc/$(NAME) - $(INSTALL) -m 644 Documentation/user-manual.html $(WINDOWSSTAGING)/share/doc/$(NAME) - for IMG in $(wildcard Documentation/images/*); do \ - $(INSTALL) -m 644 $$IMG $(WINDOWSSTAGING)/share/doc/$(NAME)/images; \ - done - - -create-windows-installer: all $(NSIFILE) install-cross-windows - $(MAKENSIS) $(NSIFILE) - -$(NSIFILE): $(NSIINPUTFILE) - $(shell cat $(NSIINPUTFILE) | sed -e 's/VERSIONTOKEN/$(VERSION_STRING)/;s/PRODVTOKEN/$(PRODVERSION_STRING)/' > $(NSIFILE)) - -$(INFOPLIST): $(INFOPLISTINPUT) - $(shell cat $(INFOPLISTINPUT) | sed -e 's/CFBUNDLEVERSION_TOKEN/$(CFBUNDLEVERSION_STRING)/' > $(INFOPLIST)) - -# Transifex merge the translations -update-po-files: - xgettext -o po/$(NAME)-new.pot -s -k_ -kN_ -ktr --keyword=C_:1c,2 --add-comments="++GETTEXT" *.c qt-ui/*.cpp - tx push -s - tx pull -af - -MOCFLAGS = $(filter -I%, $(CXXFLAGS) $(EXTRA_FLAGS)) $(filter -D%, $(CXXFLAGS) $(EXTRA_FLAGS)) - -%.o: %.c - @$(PRETTYECHO) ' CC' $< - @mkdir -p .dep/$(@D) - $(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $< - -%.o: %.cpp - @$(PRETTYECHO) ' CXX' $< - @mkdir -p .dep/$(@D) - $(COMPILE_PREFIX)$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -I.uic -Iqt-ui -MD -MF .dep/$@.dep -c -o $@ $< - -# This rule is for running the moc on QObject subclasses defined in the .h -# files. -%.moc.cpp: %.h - @$(PRETTYECHO) ' MOC' $< - $(COMPILE_PREFIX)$(MOC) $(MOCFLAGS) $< -o $@ - -# 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...") -%.moc: %.cpp - @$(PRETTYECHO) ' MOC' $< - $(COMPILE_PREFIX)$(MOC) -i $(MOCFLAGS) $< -o $@ - -# This creates the Qt resource sources. -%.qrc.cpp: %.qrc - @$(PRETTYECHO) ' RCC' $< - $(COMPILE_PREFIX)$(RCC) $< -o $@ -%.qrc: - -# Create the .ui headers in .uic searched by vpath -# Added to include path in cpp rule -.uic/ui_%.h: qt-ui/%.ui - @$(PRETTYECHO) ' UIC' $< - $(COMPILE_PREFIX)$(UIC) $< -o $@ - -share/locale/%.UTF-8/LC_MESSAGES/$(NAME).mo: po/%.po po/%.aliases - @$(PRETTYECHO) ' MSGFMT' $*.po - @mkdir -p $(dir $@) - $(COMPILE_PREFIX)msgfmt -c -o $@ po/$*.po - @-if test -s po/$*.aliases; then \ - for ALIAS in `cat po/$*.aliases`; do \ - mkdir -p share/locale/$$ALIAS/LC_MESSAGES; \ - cp $@ share/locale/$$ALIAS/LC_MESSAGES; \ - done; \ - fi - -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 -# -# The following creates the pixbuf data in .h files with the basename followed by '_pixmap' -# as name of the data structure -%.h: %.png - @echo ' gdk-pixbuf-csource' $< - @gdk-pixbuf-csource --struct --name `echo $* | sed 's/-/_/g'`_pixbuf $< > $@ - -doc: - $(MAKE) -C Documentation doc - -clean: - rm -f $(ALL_OBJS) *~ $(NAME) $(VERSION_FILE) \ - $(NAME).exe po/*~ po/$(NAME)-new.pot \ - *.moc qt-ui/*.moc \ - .uic/*.h \ - $(RESOURCES:.qrc=.qrc.cpp) - rm -rf share - -confclean: clean - rm -f $(CONFIGFILE) - rm -rf .dep .uic - -distclean: confclean - $(MAKE) -C Documentation clean - rm -f $(CREATOR_FILES) - -release: - @scripts/check-version -cr $(VERSION_STRING) - git archive --prefix $(CAPITALIZED_NAME)-$(VERSION_STRING)/ \ - --output $(CAPITALIZED_NAME)-$(VERSION_STRING).tgz \ - v$(VERSION_STRING) - -.PHONY: creator-files -creator-files: $(CREATOR_FILES) -$(NAME).files: Makefile $(CONFIGFILE) - echo $(wildcard *.h qt-ui/*.h qt-ui/*.ui) $(HEADERS) $(SOURCES) | tr ' ' '\n' | sort | uniq > $(NAME).files - { echo Makefile; echo Rules.mk; echo Configure.mk; } >> $(NAME).files -$(NAME).config: Makefile $(CONFIGFILE) - echo $(patsubst -D%,%,$(filter -D%, $(CXXFLAGS) $(CFLAGS) $(EXTRA_FLAGS))) | tr ' ' '\n' | sort | uniq > $(NAME).config -$(NAME).includes: Makefile $(CONFIGFILE) - echo $$PWD > $(NAME).includes - echo $(patsubst -I%,%,$(filter -I%, $(CXXFLAGS) $(CFLAGS) $(EXTRA_FLAGS))) | tr ' ' '\n' | sort | uniq >> $(NAME).includes -$(NAME).creator: - echo '[General]' > $(NAME).creator - -ifneq ($(CONFIGURED)$(CONFIGURING),) -.dep/%.o.dep: %.cpp - @mkdir -p $(@D) - @$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -MM -MG -MF $@ -MT $(<:.cpp=.o) -c $< -endif - -DEPS = $(addprefix .dep/,$(C_SOURCES:.c=.o.dep) $(CXX_SOURCES:.cpp=.o.dep)) --include $(DEPS) |