2008-11-17 19:04:27 +00:00
|
|
|
# Build version string, taking into account that 'VER_REV' may not be set
|
2009-09-05 09:40:57 +00:00
|
|
|
VERSION := $(strip $(shell cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2))
|
|
|
|
VER_MAJ := $(shell echo "${VERSION}" | cut -d '.' -f 1)
|
|
|
|
VER_MIN := $(shell echo "${VERSION}" | cut -d '.' -f 2)
|
|
|
|
VER_REV := $(shell echo "${VERSION}" | cut -d '.' -f 3)
|
2008-11-17 19:04:27 +00:00
|
|
|
VER_REV := $(if ${VER_REV},${VER_REV},0)
|
|
|
|
SVNREVISION := $(shell svn info | grep Revision | cut -d ' ' -f 2)
|
|
|
|
VER := $(shell echo "${VER_MAJ}.${VER_MIN}.${VER_REV}.${SVNREVISION}")
|
|
|
|
BUILDTIME := $(shell date "+%Y.%m.%d %H:%M")
|
2009-09-05 09:40:57 +00:00
|
|
|
DEB_BUILDTIME := $(shell date "+%a, %d %b %Y %H:%M:%S %z")
|
|
|
|
ifeq (${VER_REV},0)
|
|
|
|
DEB_VER := $(shell echo "${VER_MAJ}.${VER_MIN}")
|
|
|
|
else
|
|
|
|
DEB_VER := $(shell echo "${VER_MAJ}.${VER_MIN}.${VER_REV}")
|
|
|
|
endif
|
|
|
|
DEB_REV := -$(shell cat debian/revision)
|
2009-09-09 21:43:07 +00:00
|
|
|
pkg-debtest: DEB_REV := $(shell echo "~test${DEB_REV}")
|
|
|
|
pkg-debsnapshot: DEB_REV := $(shell echo "~svn${SVNREVISION}${DEB_REV}")
|
2008-11-17 10:42:14 +00:00
|
|
|
|
2008-11-15 09:54:01 +00:00
|
|
|
LIBJS_SRC_DIR=deps/Cross-platform-deps/SpiderMonkey/js/src
|
|
|
|
|
|
|
|
ifeq ($(GNUSTEP_HOST_OS),mingw32)
|
|
|
|
LIBJS=deps/Windows-x86-deps/DLLs/js32.dll
|
|
|
|
endif
|
|
|
|
ifeq ($(GNUSTEP_HOST_OS),linux-gnu)
|
|
|
|
# Set up GNU make environment
|
|
|
|
GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles
|
|
|
|
# These are the paths for our custom-built Javascript library
|
|
|
|
LIBJS_INC_DIR=$(LIBJS_SRC_DIR)
|
|
|
|
LIBJS_BIN_DIR=$(LIBJS_SRC_DIR)/Linux_All_OPT.OBJ
|
|
|
|
LIBJS=$(LIBJS_BIN_DIR)/libjs.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
DEPS=$(LIBJS)
|
|
|
|
|
|
|
|
# Here are our default targets
|
|
|
|
#
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: release
|
2008-11-15 09:54:01 +00:00
|
|
|
release: $(DEPS)
|
|
|
|
make -f GNUmakefile debug=no
|
2009-07-11 16:09:53 +00:00
|
|
|
|
2009-11-14 16:18:23 +00:00
|
|
|
.PHONY: release-deployment
|
|
|
|
release-deployment: $(DEPS)
|
|
|
|
make -f GNUmakefile DEPLOYMENT_RELEASE_CONFIGURATION=yes debug=no
|
|
|
|
|
2009-07-11 16:09:53 +00:00
|
|
|
.PHONY: release-snapshot
|
|
|
|
release-snapshot: $(DEPS)
|
|
|
|
make -f GNUmakefile SNAPSHOT_BUILD=yes VERSION_STRING=$(VER) debug=no
|
2008-11-15 09:54:01 +00:00
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: debug
|
2008-11-15 09:54:01 +00:00
|
|
|
debug: $(DEPS)
|
|
|
|
make -f GNUmakefile debug=yes
|
|
|
|
|
|
|
|
$(LIBJS):
|
|
|
|
ifeq ($(GNUSTEP_HOST_OS),mingw32)
|
|
|
|
@echo "ERROR - this Makefile can't (yet) build the Javascript DLL"
|
|
|
|
@echo " Please build it yourself and copy it to $(LIBJS)."
|
|
|
|
false
|
|
|
|
endif
|
|
|
|
make -C $(LIBJS_SRC_DIR) -f Makefile.ref BUILD_OPT=1
|
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: clean
|
2008-11-15 09:54:01 +00:00
|
|
|
clean:
|
|
|
|
ifneq ($(GNUSTEP_HOST_OS),mingw32)
|
|
|
|
make -C $(LIBJS_SRC_DIR)/editline -f Makefile.ref clobber
|
|
|
|
make -C $(LIBJS_SRC_DIR) -f Makefile.ref clobber
|
|
|
|
find $(LIBJS_SRC_DIR) -name "Linux_All_*.OBJ" | xargs rm -Rf
|
|
|
|
endif
|
|
|
|
make -f GNUmakefile clean
|
|
|
|
rm -Rf obj obj.dbg oolite.app
|
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: all
|
2009-11-14 16:18:23 +00:00
|
|
|
all: release release-deployment release-snapshot debug
|
2008-11-15 09:54:01 +00:00
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: remake
|
2008-11-15 09:54:01 +00:00
|
|
|
remake: clean all
|
|
|
|
|
2009-09-04 16:44:01 +00:00
|
|
|
# Here are our linux autopackager targets
|
|
|
|
#
|
|
|
|
pkg-autopackage:
|
2009-12-06 02:28:47 +00:00
|
|
|
makepackage -c -m installers/autopackage/default.apspec
|
2009-09-04 16:44:01 +00:00
|
|
|
|
2008-11-15 09:54:01 +00:00
|
|
|
# Here are our Debian packager targets
|
|
|
|
#
|
2009-09-05 09:40:57 +00:00
|
|
|
.PHONY: debian/changelog
|
|
|
|
debian/changelog:
|
2009-09-09 21:43:07 +00:00
|
|
|
cat debian/changelog.in | sed -e "s/@@VERSION@@/${DEB_VER}/g" -e "s/@@REVISION@@/${DEB_REV}/g" -e "s/@@TIMESTAMP@@/${DEB_BUILDTIME}/g" > debian/changelog
|
2009-09-05 09:40:57 +00:00
|
|
|
|
|
|
|
.PHONY: pkg-deb pkg-debtest pkg-debsnapshot
|
|
|
|
pkg-deb: debian/changelog
|
|
|
|
debuild binary
|
|
|
|
|
|
|
|
pkg-debtest: debian/changelog
|
|
|
|
debuild binary
|
|
|
|
|
|
|
|
pkg-debsnapshot: debian/changelog
|
2008-11-15 09:54:01 +00:00
|
|
|
debuild binary
|
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: pkg-debclean
|
2008-11-15 09:54:01 +00:00
|
|
|
pkg-debclean:
|
|
|
|
debuild clean
|
|
|
|
|
|
|
|
# And here are our Windows packager targets
|
|
|
|
#
|
|
|
|
NSIS="C:\Program Files\NSIS\makensis.exe"
|
2008-11-17 10:42:14 +00:00
|
|
|
NSISVERSIONS=installers/win32/OoliteVersions.nsh
|
|
|
|
|
|
|
|
# Passing arguments cause problems with some versions of NSIS.
|
|
|
|
# Because of this, we generate them into a separate file and include them.
|
|
|
|
.PHONY: ${NSISVERSIONS}
|
|
|
|
${NSISVERSIONS}:
|
|
|
|
@echo "; Version Definitions for Oolite" > $@
|
|
|
|
@echo "; NOTE - This file is auto-generated by the Makefile, any manual edits will be overwritten" >> $@
|
2008-11-17 19:04:27 +00:00
|
|
|
@echo "!define VER_MAJ ${VER_MAJ}" >> $@
|
|
|
|
@echo "!define VER_MIN ${VER_MIN}" >> $@
|
|
|
|
@echo "!define VER_REV ${VER_REV}" >> $@
|
2008-11-17 10:42:14 +00:00
|
|
|
@echo "!define SVNREV ${SVNREVISION}" >> $@
|
2008-11-17 19:04:27 +00:00
|
|
|
@echo "!define VERSION ${VER}" >> $@
|
2008-11-17 10:42:14 +00:00
|
|
|
@echo "!define BUILDTIME \"${BUILDTIME}\"" >> $@
|
|
|
|
|
|
|
|
.PHONY: pkg-win
|
|
|
|
pkg-win: release ${NSISVERSIONS}
|
2008-11-15 14:21:56 +00:00
|
|
|
$(NSIS) installers/win32/OOlite.nsi
|
2009-11-14 16:18:23 +00:00
|
|
|
|
|
|
|
.PHONY: pkg-win-deployment
|
|
|
|
pkg-win-deployment: release-deployment ${NSISVERSIONS}
|
|
|
|
$(NSIS) installers/win32/OOlite.nsi
|
2008-11-15 09:54:01 +00:00
|
|
|
|
2008-11-17 10:42:14 +00:00
|
|
|
.PHONY: pkg-win-snapshot
|
2009-07-11 16:09:53 +00:00
|
|
|
pkg-win-snapshot: release-snapshot ${NSISVERSIONS}
|
2008-11-17 10:42:14 +00:00
|
|
|
@echo "!define SNAPSHOT 1" >> ${NSISVERSIONS}
|
|
|
|
$(NSIS) installers/win32/OOlite.nsi
|
|
|
|
|
|
|
|
.PHONY: help
|
2008-11-15 09:54:01 +00:00
|
|
|
help:
|
|
|
|
@echo "Use this Makefile to build Oolite:"
|
|
|
|
@echo " release - builds a release executable in oolite.app/oolite"
|
|
|
|
@echo " debug - builds a debug executable in oolite.app/oolite.dbg"
|
|
|
|
@echo " all - builds the above two targets"
|
|
|
|
@echo " clean - removes all generated files"
|
|
|
|
@echo
|
2009-09-05 09:40:57 +00:00
|
|
|
@echo " pkg-deb - builds a release Debian package"
|
|
|
|
@echo " pkg-debtest - builds a test release Debian package"
|
|
|
|
@echo " pkg-debsnapshot - builds a snapshot release Debian package"
|
2008-11-15 09:54:01 +00:00
|
|
|
@echo " pkg-debclean - cleans up after a Debian package build"
|
|
|
|
@echo
|
2009-09-05 09:40:57 +00:00
|
|
|
@echo " pkg-autopackage - builds a Linux autopackage"
|
|
|
|
@echo
|
2009-11-14 16:18:23 +00:00
|
|
|
@echo " pkg-win - builds a release version Windows installer package (test release)"
|
|
|
|
@echo " pkg-win-deployment - builds a release version Windows installer package (deployment release)"
|
2008-11-17 10:42:14 +00:00
|
|
|
@echo " pkg-win-snapshot - builds a snapshot version Windows installer package"
|