From 486d15d50d4d83f8e8ea7622245d80dacb11339d Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 28 Nov 2018 18:31:03 -0500 Subject: [PATCH] First step to freebsd builds. --- Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 96b8b431..6fd356c5 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +.POSIX: ################################ ##### Set global variables ##### @@ -29,7 +30,6 @@ LIBDIR=$(PREFIX)/lib BINDIR=$(PREFIX)/bin JANET_VERSION?="\"commit-$(shell git log --pretty=format:'%h' -n 1)\"" -#CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -g -DJANET_VERSION=$(JANET_VERSION) CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \ -DJANET_VERSION=$(JANET_VERSION) CLIBS=-lm -ldl @@ -38,15 +38,10 @@ JANET_LIBRARY=libjanet.so JANET_PATH?=/usr/local/lib/janet DEBUGGER=gdb +# Some system specifics (for macOS) UNAME:=$(shell uname -s) -LDCONFIG:=ldconfig -ifeq ($(UNAME), Darwin) - # Add other macos/clang flags - LDCONFIG:= -else - CFLAGS:=$(CFLAGS) -rdynamic - CLIBS:=$(CLIBS) -lrt -endif +LDCONFIG:=$(shell [ $(UNAME) != Darwin ] && echo "ldconfig") +CLIBS:="$(CLIBS) $(shell [ $(UNAME) != Darwin ] && echo "-lrt -rdynamic")" # Source headers JANET_GENERATED_HEADERS= \