From 185f4b0202ace98bfde96f85c89df1d54f554b7a Mon Sep 17 00:00:00 2001 From: Brandon Rhodes Date: Mon, 19 Feb 2024 18:24:08 -0500 Subject: [PATCH] Fix Makefile for Apple Silicon M1 and add CI build --- .github/workflows/ci.yml | 17 +++++++++++++++++ GUI/xephem/Makefile | 9 +++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a07adc3..3f296e7 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,20 @@ jobs: run: make -C GUI/xephem - name: Test run: make -C tests + + compile-apple-silicon: + runs-on: macos-14 + steps: + - uses: actions/checkout@v2 + - name: Install OpenMotif + run: brew install openmotif && brew info openmotif + - name: Install groff + run: brew install groff && brew info groff + - name: Install OpenSSL + run: brew install openssl && brew info openssl + - name: Install XQuartz + run: brew install xquartz --cask && brew info xquartz + - name: Compile + run: make -C GUI/xephem + - name: Test + run: make -C tests diff --git a/GUI/xephem/Makefile b/GUI/xephem/Makefile index 9861fd4..274269b 100644 --- a/GUI/xephem/Makefile +++ b/GUI/xephem/Makefile @@ -29,11 +29,16 @@ MOTIFL = /usr/lib endif # For Linux and Apple OS X +# /opt/homebrew is for modern Apple Silicon; the other paths, for older macOS. UNAME_S = $(shell uname -s) ifeq ($(UNAME_S),Darwin) - PLATI = -I/usr/local/opt/openssl@3/include -I/opt/X11/include - PLATL = -L/usr/local/opt/openssl@3/lib -L/opt/X11/lib + PLATI = -I/opt/homebrew/include \ + -I/usr/local/opt/openssl@3/include \ + -I/opt/X11/include + PLATL = -L/opt/homebrew/lib \ + -L/usr/local/opt/openssl@3/lib \ + -L/opt/X11/lib endif CC = gcc