Support Mac compilation under GitHub Actions

This commit is contained in:
Brandon Rhodes 2022-01-24 17:03:28 -05:00
parent 1312f91f9e
commit a491bd8b84
2 changed files with 26 additions and 4 deletions

View File

@ -3,7 +3,7 @@ name: ci
on:
push:
branches:
- macos-ci
- macos-brew-motif
pull_request:
branches:
@ -18,3 +18,16 @@ jobs:
run: grep 'sudo apt install' INSTALL | sed 's/\$//' | sh
- name: Compile
run: make -C GUI/xephem
compile-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install OpenMotif
run: brew install openmotif && brew info openmotif
- 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

View File

@ -28,11 +28,20 @@ ifndef MOTIFL
MOTIFL = /usr/lib
endif
# for linux and Apple OS X
# For Linux and Apple OS X
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
endif
CC = gcc
CLDFLAGS = -g
CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) -I/opt/X11/include
LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) -L/opt/X11/lib
CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) $(PLATI)
LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) $(PLATL)
XLIBS = -lXm -lXt -lXext -lXmu -lX11
LIBS = $(XLIBS) $(LIBLIB) -lm -lssl