1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-24 09:17:17 +00:00

Only use -rdyanmic at link time

Before, we were using -rdynamic as a compiler flag, but
it is only needed at link time. This also gets rid of some
annoying warnings in clang.
This commit is contained in:
Calvin Rose 2019-03-03 18:55:10 -05:00
parent 9ed1c35d30
commit a4cc23971f

View File

@ -36,16 +36,18 @@ DEBUGGER=gdb
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \
-DJANET_BUILD=$(JANET_BUILD)
LDFLAGS=-rdynamic
# Check OS
UNAME:=$(shell uname -s)
ifeq ($(UNAME), Darwin)
# Add other macos/clang flags
CLIBS:=$(CLIBS) -ldl
else ifeq ($(UNAME), Linux)
CLIBS:=$(CLIBS) -lrt -ldl
else ifeq ($(UNAME), FreeBSD)
CLIBS:=$(CLIBS) -ldl
else ifeq ($(UNAME), OpenBSD)
# pass ...
else
CFLAGS:=$(CFLAGS) -rdynamic
CLIBS:=$(CLIBS) -lrt -ldl
CLIBS:=$(CLIBS) -ldl
endif
$(shell mkdir -p build/core build/mainclient build/webclient build/boot)
@ -95,10 +97,10 @@ build/%.o: src/%.c $(JANET_HEADERS) $(JANET_LOCAL_HEADERS)
$(CC) $(CFLAGS) -o $@ -c $<
$(JANET_TARGET): $(JANET_CORE_OBJECTS) $(JANET_MAINCLIENT_OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(CLIBS)
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(CLIBS)
$(JANET_LIBRARY): $(JANET_CORE_OBJECTS)
$(CC) $(CFLAGS) -shared -o $@ $^ $(CLIBS)
$(CC) $(LDFLAGS) $(CFLAGS) -shared -o $@ $^ $(CLIBS)
######################
##### Emscripten #####