aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml32
-rw-r--r--Makefile2
2 files changed, 28 insertions, 6 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1d6c5dba..2be7084e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,6 +5,10 @@ on:
tags:
- 'v*'
+permissions:
+ contents: write
+ packages: write
+
jobs:
linux-x86_64:
runs-on: ubuntu-latest
@@ -84,10 +88,31 @@ jobs:
brew update
brew install gmp libunistring bdw-gc llvm binutils
- - name: Build
+ - name: Build arm64
run: |
make clean
- make -j
+ make -j \
+ CC=clang \
+ CFLAGS="-arch arm64" \
+ LDFLAGS="-arch arm64"
+ mv build/tomo build/tomo-arm64
+
+ - name: Build x86_64
+ run: |
+ make clean
+ make -j \
+ CC=clang \
+ CFLAGS="-arch x86_64" \
+ LDFLAGS="-arch x86_64"
+ mv build/tomo build/tomo-x86_64
+
+ - name: Create universal binary
+ run: |
+ lipo -create \
+ build/tomo-arm64 \
+ build/tomo-x86_64 \
+ -output build/tomo
+ lipo -info build/tomo
- name: Package
run: |
@@ -102,6 +127,3 @@ jobs:
tomo-macos-universal.tar.gz
tomo-macos-universal.tar.gz.sha256
-permissions:
- contents: write
- packages: write
diff --git a/Makefile b/Makefile
index 965ccbe3..855c8b09 100644
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,7 @@ O=-O3
# Note: older versions of Make have buggy behavior with hash marks inside strings, so this ugly code is necessary:
TOMO_VERSION=$(shell awk 'BEGIN{hashes=sprintf("%c%c",35,35)} $$1==hashes {print $$2; exit}' CHANGES.md)
GIT_VERSION=$(shell git log -1 --pretty=format:"%as_%h" 2>/dev/null || echo "unknown")
-CFLAGS=$(CCONFIG) $(INCLUDE_DIRS) $(EXTRA) $(CWARN) $(G) $(O) $(OSFLAGS) $(LTO) \
+CFLAGS += $(CCONFIG) $(INCLUDE_DIRS) $(EXTRA) $(CWARN) $(G) $(O) $(OSFLAGS) $(LTO) \
-DSUDO='"$(SUDO)"' -DDEFAULT_C_COMPILER='"$(DEFAULT_C_COMPILER)"' \
-DGIT_VERSION='"$(GIT_VERSION)"'
CFLAGS_PLACEHOLDER="$$(printf '\033[2m<flags...>\033[m\n')"