From b7cfd2fe2cc2cbcaffb0c00803a73a8bbb6a7637 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 2 Aug 2012 10:52:38 +0000 Subject: [PATCH] Lunatic: fix build on OS X, pass LUNATIC define to build/ sources. git-svn-id: https://svn.eduke32.com/eduke32@2860 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 6 ++++++ polymer/eduke32/build/Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 7c8a710cc..b4badc991 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -411,7 +411,13 @@ $(OBJ)/%.$o: $(SRC)/%.c # Create object files directly with luajit $(OBJ)/luaJIT_BC_%.$o: $(SRC)/lunatic/%.lua $(COMPILE_STATUS) +ifeq ($(PLATFORM),DARWIN) + # LuaJIT on OS X doesn't support writing Mach-O objects as of beta-10, + # so we pipe the C source into GCC. + if $(LUAJIT) -bg -t c $< - | $(CC) -xc -c - -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi +else if $(LUAJIT) -bg $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi +endif $(OBJ)/%.$o: $(SRC)/lunatic/%.c $(COMPILE_STATUS) diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 79ff5c520..10966f59c 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -55,7 +55,7 @@ OURASFLAGS=$(BASEASFLAGS) OURLDFLAGS=$(BASELDFLAGS) $(BUILDLDFLAGS) ifneq ($(LUNATIC),0) - OURCFLAGS+= -DLUNATIC_ENABLE + OURCFLAGS+= -DLUNATIC endif UTILLIBS= -lm # -lpthread