diff --git a/client/Makefile b/client/Makefile index 135b143e4..490716eda 100644 --- a/client/Makefile +++ b/client/Makefile @@ -31,7 +31,14 @@ platform = $(shell uname) VPATH = ../common ../zlib ../uart OBJDIR = obj -LDLIBS = -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm -Wl,--as-needed -latomic -Wl,--no-as-needed +LDLIBS = -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm +# RPi Zero gcc requires -latomic +# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld +# doesn't recognize option --as-needed +ifneq ($(platform),Darwin) + LDLIBS += -Wl,--as-needed -latomic -Wl,--no-as-needed +endif + LUALIB = ../liblua/liblua.a JANSSONLIBPATH = ./jansson JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a