Let the Makefile generate a game.dynlib on OS X

This should have been done years ago, .dynlib is the canocial extension
for libraries on OS X. In a broader sense this simplifies the CMake
build system a little bit, since CMake enforces .dynlib for OS X
libraries.
This commit is contained in:
Yamagi Burmeister 2015-08-12 18:55:35 +02:00
parent 870af22e75
commit 565f7f6e67
2 changed files with 19 additions and 2 deletions

View file

@ -502,7 +502,20 @@ build/baseq2/%.o: %.c
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
release/baseq2/game.dll : LDFLAGS += -shared
else # not Windows
else ifeq ($(OSTYPE), Darwin)
game:
@echo "===> Building baseq2/game.dynlib"
${Q}mkdir -p release/baseq2
$(MAKE) release/baseq2/game.dynlib
build/baseq2/%.o: %.c
@echo "===> CC $<"
${Q}mkdir -p $(@D)
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
release/baseq2/game.dynlib : CFLAGS += -fPIC
release/baseq2/game.dynlib : LDFLAGS += -shared
else # not Windows or Darwin
game:
@echo "===> Building baseq2/game.so"
${Q}mkdir -p release/baseq2
@ -769,6 +782,10 @@ release/baseq2/game.dll : $(GAME_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(GAME_OBJS) $(LDFLAGS) -o $@
$(Q)strip $@
else ifeq ($(OSTYPE), Darwin)
release/baseq2/game.dynlib : $(GAME_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(GAME_OBJS) $(LDFLAGS) -o $@
else
release/baseq2/game.so : $(GAME_OBJS)
@echo "===> LD $@"

View file

@ -388,7 +388,7 @@ Sys_GetGameAPI(void *parms)
char name[MAX_OSPATH];
char *path;
char *str_p;
#if PLATFORM_MAC_OSX
#ifdef __APPLE__
const char *gamename = "game.dylib";
#else
const char *gamename = "game.so";