From 870d3330311feeb4defade6adfed93d24e4b5345 Mon Sep 17 00:00:00 2001 From: Camden Narzt Date: Fri, 26 Jul 2024 19:34:16 -0600 Subject: [PATCH] more attempts to fix CI --- .github/workflows/actions.yml | 2 +- Makefile | 2 +- Makefile-variables | 56 ++++++++++++++++------------------- 3 files changed, 28 insertions(+), 32 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 661ae6f..437996e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -140,7 +140,7 @@ jobs: GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com - MACOS_VER_NUM: 14 + MACOS_VER_NUM: 14.0 CERT_IDENTITY: me LDLIBS: -lgetargv CXXFLAGS: -Iinclude diff --git a/Makefile b/Makefile index 8a66149..55cbbac 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ $(DMG): $(PRODUCT) $(DISTRIBUTION): $(SRC_DIR)/dist.xml < $< > $@ sed \ - -e 's/OS_VERSION/$(MACOS_VER_NUM)/g' \ + -e 's/OS_VERSION/$(MACOSX_DEPLOYMENT_TARGET)/g' \ -e 's/ARCH/$(ARCH)/g' \ -e 's/VERSION/$(VERSION)/g' \ -e 's/LIB_PKG_NAME/$(LIB_PKG:$(PKG_DIR)/%=%)/g' \ diff --git a/Makefile-variables b/Makefile-variables index 0e0e2c0..9e7f238 100644 --- a/Makefile-variables +++ b/Makefile-variables @@ -1,7 +1,5 @@ -PREFIX ?= /usr/local -ifndef MACOS_VER_NUM -MACOS_VER_NUM := $(shell vtool -show-build $(shell pkg-config --variable=libdir getargv)/libgetargv.dylib | awk '/minos/{print $$2}') -endif +PREFIX ?= /usr/local +MACOS_VER_NUM ?= $(shell vtool -show-build $(shell pkg-config --variable=libdir getargv)/libgetargv.dylib | awk '/minos/{print $$2}') MACOS_VER_MAJOR := $(shell echo $(MACOS_VER_NUM) | cut -f1 -d.) MACOS_VER_MINOR := $(shell echo $(MACOS_VER_NUM) | cut -f2 -d.) MACOS_LT_10_11 := $(shell [ $(MACOS_VER_MAJOR) -eq 10 -a $(MACOS_VER_MINOR) -lt 11 ] && echo true) @@ -12,22 +10,20 @@ export MACOSX_DEPLOYMENT_TARGET := $(MACOS_VER_MAJOR).$(MACOS_VER_MINOR) # When changing version, also change: getargv++.pc, doxygen.conf, and README.md VERSION=0.9 # -COMPAT_VERSION := $(shell echo $(VERSION) | cut -f1 -d.).0 -ARCH := $(shell uname -m) +COMPAT_VERSION := $(shell echo $(VERSION) | cut -f1 -d.).0 +ARCH := $(shell uname -m) CODESIGN_PREFIX := cam.narzt. KEYCHAIN := ~/Library/Keychains/login.keychain-db -ifndef CERT_IDENTITY -CERT_IDENTITY := $(shell security find-identity -v -p codesigning | sed -Ee 's/.*"([^"]+)".*/\1/g' | grep -Fve ' valid identit' -e ' CA') -endif +CERT_IDENTITY ?= $(shell security find-identity -v -p codesigning | sed -Ee 's/.*"([^"]+)".*/\1/g' | grep -Fve ' valid identit' -e ' CA') -SRC_DIR = src -INCLUDE_DIR = include -OBJ_DIR = obj -LIB_DIR = lib -PKG_DIR = pkg -FAKE_ROOT = fakeroot -CXX = clang++ -CPPFLAGS := -MMD -MP +SRC_DIR := src +INCLUDE_DIR := include +OBJ_DIR := obj +LIB_DIR := lib +PKG_DIR := pkg +FAKE_ROOT := fakeroot +CXX := clang++ +CPPFLAGS := -MMD -MP COMPILER_VERSION := $(shell $(CXX) --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\.*[0-9]*" | head -n 1) COMPILER_VERSION_NUMBER := $(shell echo $(COMPILER_VERSION) | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/') @@ -35,30 +31,30 @@ CLANG_13_OR_MORE := $(shell expr $(COMPILER_VERSION_NUMBER) \>= 130106) ifneq ($(CLANG_13_OR_MORE),0) # supported: c++11, c++14, c++17, c++20 # future: c++2b -CXXFLAGS := --std=c++20 -O3 -Iinclude $(shell pkg-config --cflags getargv) +CXXFLAGS ?= --std=c++20 -O3 -Iinclude $(shell pkg-config --cflags getargv) else -CXXFLAGS := --std=c++17 -O3 -Iinclude $(shell pkg-config --cflags getargv) +CXXFLAGS ?= --std=c++17 -O3 -Iinclude $(shell pkg-config --cflags getargv) endif EXTRA_CXXFLAGS := -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic -Wno-poison-system-directories -LDFLAGS := -Llib -fvisibility=default -fPIC -LDLIBS := $(shell pkg-config --libs getargv) +LDFLAGS := -Llib -fvisibility=default -fPIC +LDLIBS ?= $(shell pkg-config --libs getargv) -LIB_SHORT_NAME = getargv++ -LIB_NAME = lib$(LIB_SHORT_NAME) -DYLIB_FILENAME = $(LIB_NAME).$(VERSION).dylib -DYLIB = lib/$(DYLIB_FILENAME) -SOURCES = $(wildcard $(SRC_DIR)/*.cpp) -HEADERS = $(wildcard $(INCLUDE_DIR)/*.hpp) -OBJECTS = $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) +LIB_SHORT_NAME := getargv++ +LIB_NAME := lib$(LIB_SHORT_NAME) +DYLIB_FILENAME := $(LIB_NAME).$(VERSION).dylib +DYLIB := lib/$(DYLIB_FILENAME) +SOURCES := $(wildcard $(SRC_DIR)/*.cpp) +HEADERS := $(wildcard $(INCLUDE_DIR)/*.hpp) +OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) DMG_VOLUME_NAME := $(LIB_NAME) Installer DMG := $(PKG_DIR)/$(LIB_NAME).dmg PRODUCT_BUNDLE_PACKAGE_TYPE := APPL LIB_BUNDLE_IDENTIFIER := $(CODESIGN_PREFIX)$(LIB_NAME) PRODUCT_BUNDLE_IDENTIFIER := $(LIB_BUNDLE_IDENTIFIER) -PRODUCT := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOS_VER_NUM)-$(ARCH).pkg -LIB_PKG := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOS_VER_NUM)-$(ARCH)-package.pkg +PRODUCT := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOSX_DEPLOYMENT_TARGET)-$(ARCH).pkg +LIB_PKG := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOSX_DEPLOYMENT_TARGET)-$(ARCH)-package.pkg DISTRIBUTION := $(OBJ_DIR)/dist.xml ifeq ($(MACOS_LT_10_11),true)