Commit 45e347a1 authored by Andreas Freise's avatar Andreas Freise

adding new Makefile and build script from master

parent 6f0aed49
......@@ -510,8 +510,6 @@ case $TARGET in
;;
$TARGET_MAC)
check_prerequisites || failure
# This sets the minimum required build compatiability, this should
# be kept low to provide a broad support
OSXminor=7
#`sw_vers -productVersion | cut -d'.' -f2`
......@@ -524,16 +522,15 @@ case $TARGET in
# probably should allow custom minor version for build-mac
export MACOSX_DEPLOYMENT_TARGET="10.$OSXminor"
if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/ ]; then
echo "Preparing Mac OS X SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/"
export OSX_CFLAGS="$NATIVE $OPTIM_CFLAGS -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=13"
if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/ ]; then
echo "Preparing Mac OS X 10.15 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/"
export OSX_CFLAGS="$NATIVE $OPTIM_CFLAGS -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=15"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
export LDFLAGS=$OSX_LDFLAGS
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/ ]; then
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/ ]; then
echo "Preparing Mac OS X 10.14 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/"
export OSX_CFLAGS="$NATIVE $OPTIM_CFLAGS -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=14"
......@@ -541,7 +538,7 @@ case $TARGET in
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
export LDFLAGS=$OSX_LDFLAGS
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/ ]; then
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/ ]; then
echo "Preparing Mac OS X 10.13 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/"
export OSX_CFLAGS="$NATIVE $OPTIM_CFLAGS -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=13"
......@@ -597,14 +594,6 @@ case $TARGET in
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
export LDFLAGS=$OSX_LDFLAGS
elif [ -d /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ ]; then
echo "Preparing Command Line Tools Mac OS X SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
export OSX_CFLAGS="$NATIVE $OPTIM_CFLAGS -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=13"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
export LDFLAGS=$OSX_LDFLAGS
elif [ -d /Developer/SDKs/MacOSX10.6.sdk ]; then
echo "Preparing Mac OS X 10.6 x86_64 SDK build environment..." | tee -a $LOGFILE
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $LDFLAGS"
......
......@@ -7,6 +7,11 @@
#
SHELL = bash
# Hard coded version string in case it cannot be derived using git, this needs to be
# updated manually upon every release!
VERSION = 2.2
SHA = 2.2-33-g9b50c06
.PHONY: clean tags cover_report test_clean api_clean
ifeq "$(ARCH)" "linux"
......@@ -207,10 +212,22 @@ PREREQS += $(OBJECTS)
# determine short SHA of git commit
#GIT_SHA_CMD = $(GIT) rev-parse --verify HEAD --short
GIT_SHA_CMD = $(GIT) describe --long
GIT_SHA = $(shell $(GIT_SHA_CMD))
GIT_VER_CMD = $(GIT) describe --abbrev=0
GIT_VERSION = $(shell $(GIT_VER_CMD))
#GIT_SHA_CMD = $(GIT) describe --long | awk '{ sub("-",".",$0)}1'
GIT_SHA_CMD = $(GIT) describe --long 2>/dev/null
GIT_SHA = $(shell $(GIT_SHA_CMD))
#GIT_VER_CMD = $(GIT) describe --long | awk '{ sub("-",".",$0)}1' | cut -d- -f1
GIT_VER_CMD = $(GIT) describe --abbrev=0 2>/dev/null
GIT_VERSION = $(shell $(GIT_VER_CMD))
ifeq ($(strip $(GIT_VERSION)),)
GIT_VERSION=$(VERSION)
endif
ifeq ($(strip $(GIT_SHA)),)
GIT_SHA=$(SHA)
endif
# Rewriting the SHA to replace the first - with a . for A.B.C like version string
VERSION_LIST = $(word $2, $(subst -, ,$(GIT_SHA)))
GIT_SHA_REWRITE=$(call VERSION_LIST,$*,1).$(call VERSION_LIST,$*,2)-$(call VERSION_LIST,$*,3)
# the default target
default: kat
......@@ -219,7 +236,7 @@ FAST_CFLAGS=$(BASE_CFLAGS)
# compile objects from c code
%.o: %.c
$(CC) ${GSL_CFLAGS} $(BASE_CFLAGS) -c $(INCLUDES) $<
# make all
all: kat win test versionnumber
......@@ -331,7 +348,7 @@ versionnumber: config $(PREREQS)
# generate the config file
config:
# output the value of GIT_SHA to kat_config.h
@echo "#define GIT_REVISION \"$(GIT_SHA)\"" > $(KAT_CONFIG_H)
@echo "#define GIT_REVISION \"$(GIT_SHA_REWRITE)\"" > $(KAT_CONFIG_H)
@echo "#define VERSION \"$(GIT_VERSION)\"" >> $(KAT_CONFIG_H)
@echo \#define MYTIME \"`date +%d.%m.%Y`\" >> $(KAT_CONFIG_H)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment