yquake2/xatrix

Unable to compile xatrix game.so on macOS 10.12.6

Closed this issue · 1 comments

Compiled yquake2 from source on macOS 10.12.6 with all dependencies present. Attempting to compile game.so for xatrix and rogue from source yields the following message when executing make:

make[1]: *** No rule to make target `release/game.so'.  Stop.
make: *** [xatrix] Error 2

Okay, I managed to solve this. It really went over my head why the makefile was trying to generate a game.so file rather than game.dylib for Darwin.

It looks like there is a code block missing in both the xatrix and rogue makefile. I added the following on line 158 between OSTYPE Windows and else (or just rename the two instances of game.so to game.dylib:

else ifeq ($(OSTYPE), Darwin)
xatrix:
	@echo "===> Building game.dylib"
	${Q}mkdir -p release
	$(MAKE) release/game.dylib

build/%.o: %.c
	@echo "===> CC $<"
	${Q}mkdir -p $(@D)
	${Q}$(CC) -c $(CFLAGS) -o $@ $<

I ran make again and was able to compile a working game.dylib

Unsure if release/game.so : CFLAGS += -fPIC is also required for Darwin