Skip to content

Commit

Permalink
Merge pull request #52 from xyb/macosm1
Browse files Browse the repository at this point in the history
Makefile: support Apple M1
  • Loading branch information
noxdafox committed Nov 8, 2022
2 parents 625e640 + cd03d16 commit cdc3fe4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# vim: tabstop=8
PYTHON ?= python
CLIPS_VERSION ?= 6.40
CLIPS_SOURCE_URL ?= "https://sourceforge.net/projects/clipsrules/files/CLIPS/6.40/clips_core_source_640.zip"
Expand All @@ -17,11 +18,16 @@ clips_source:
unzip -jo clips.zip -d clips_source

ifeq ($(PLATFORM),Darwin) # macOS
TARGET_ARCH ?= $(shell uname -m)
LDLIBS = -lm
ifneq "$(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib)" ""
LDLIBS += -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
endif
clips: clips_source
$(MAKE) -f $(MAKEFILE_NAME) -C clips_source \
CFLAGS="-std=c99 -O3 -fno-strict-aliasing -fPIC" \
LDLIBS="-lm"
ld clips_source/*.o -lm -dylib -arch x86_64 \
LDLIBS="$(LDLIBS)"
ld clips_source/*.o $(LDLIBS) -dylib -arch $(TARGET_ARCH) \
-o clips_source/libclips.so
else
clips: clips_source
Expand Down

0 comments on commit cdc3fe4

Please sign in to comment.