summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-24 22:06:45 +0000
committerTim Angus <tim@ngus.net>2013-03-25 23:29:16 +0000
commit0ca0efbe6d0089ab1844726b159248cc6566d419 (patch)
tree1bae8cf09a2dde999f5b06a870d0f46aacceb569 /Makefile
parent3ce3590596390b4f2d432cbb7b00256c26358122 (diff)
Enable building QVMs when cross-compiling
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 25 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 1631a566..93e1cfa3 100644
--- a/Makefile
+++ b/Makefile
@@ -537,6 +537,10 @@ ifeq ($(PLATFORM),mingw32)
BINEXT=.exe
+ ifeq ($(CROSS_COMPILING),0)
+ TOOLS_BINEXT=.exe
+ endif
+
LIBS= -lws2_32 -lwinmm -lpsapi
CLIENT_LDFLAGS += -mwindows
CLIENT_LIBS = -lgdi32 -lole32
@@ -864,12 +868,10 @@ ifneq ($(BUILD_GAME_SO),0)
endif
ifneq ($(BUILD_GAME_QVM),0)
- ifneq ($(CROSS_COMPILING),1)
- TARGETS += \
- $(B)/$(BASEGAME)/vm/cgame.qvm \
- $(B)/$(BASEGAME)/vm/game.qvm \
- $(B)/$(BASEGAME)/vm/ui.qvm
- endif
+ TARGETS += \
+ $(B)/$(BASEGAME)/vm/cgame.qvm \
+ $(B)/$(BASEGAME)/vm/game.qvm \
+ $(B)/$(BASEGAME)/vm/ui.qvm
endif
ifeq ($(USE_OPENAL),1)
@@ -1170,6 +1172,11 @@ makedirs:
# QVM BUILD TOOLS
#############################################################################
+ifndef TOOLS_CC
+ # A compiler which probably produces native binaries
+ TOOLS_CC = gcc
+endif
+
TOOLS_OPTIMIZE = -g -Wall -fno-strict-aliasing
TOOLS_CFLAGS += $(TOOLS_OPTIMIZE) \
-DTEMPDIR=\"$(TEMPDIR)\" -DSYSTEM=\"\" \
@@ -1184,20 +1191,20 @@ endif
define DO_TOOLS_CC
$(echo_cmd) "TOOLS_CC $<"
-$(Q)$(CC) $(TOOLS_CFLAGS) -o $@ -c $<
+$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) -o $@ -c $<
endef
define DO_TOOLS_CC_DAGCHECK
$(echo_cmd) "TOOLS_CC_DAGCHECK $<"
-$(Q)$(CC) $(TOOLS_CFLAGS) -Wno-unused -o $@ -c $<
+$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) -Wno-unused -o $@ -c $<
endef
-LBURG = $(B)/tools/lburg/lburg$(BINEXT)
+LBURG = $(B)/tools/lburg/lburg$(TOOLS_BINEXT)
DAGCHECK_C = $(B)/tools/rcc/dagcheck.c
-Q3RCC = $(B)/tools/q3rcc$(BINEXT)
-Q3CPP = $(B)/tools/q3cpp$(BINEXT)
-Q3LCC = $(B)/tools/q3lcc$(BINEXT)
-Q3ASM = $(B)/tools/q3asm$(BINEXT)
+Q3RCC = $(B)/tools/q3rcc$(TOOLS_BINEXT)
+Q3CPP = $(B)/tools/q3cpp$(TOOLS_BINEXT)
+Q3LCC = $(B)/tools/q3lcc$(TOOLS_BINEXT)
+Q3ASM = $(B)/tools/q3asm$(TOOLS_BINEXT)
LBURGOBJ= \
$(B)/tools/lburg/lburg.o \
@@ -1208,7 +1215,7 @@ $(B)/tools/lburg/%.o: $(LBURGDIR)/%.c
$(LBURG): $(LBURGOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
+ $(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
Q3RCCOBJ = \
$(B)/tools/rcc/alloc.o \
@@ -1253,7 +1260,7 @@ $(B)/tools/rcc/%.o: $(Q3LCCSRCDIR)/%.c
$(Q3RCC): $(Q3RCCOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
+ $(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
Q3CPPOBJ = \
$(B)/tools/cpp/cpp.o \
@@ -1272,7 +1279,7 @@ $(B)/tools/cpp/%.o: $(Q3CPPDIR)/%.c
$(Q3CPP): $(Q3CPPOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
+ $(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
Q3LCCOBJ = \
$(B)/tools/etc/lcc.o \
@@ -1283,7 +1290,7 @@ $(B)/tools/etc/%.o: $(Q3LCCETCDIR)/%.c
$(Q3LCC): $(Q3LCCOBJ) $(Q3RCC) $(Q3CPP)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(Q3LCCOBJ) $(TOOLS_LIBS)
+ $(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(Q3LCCOBJ) $(TOOLS_LIBS)
define DO_Q3LCC
$(echo_cmd) "Q3LCC $<"
@@ -1315,7 +1322,7 @@ $(B)/tools/asm/%.o: $(Q3ASMDIR)/%.c
$(Q3ASM): $(Q3ASMOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
+ $(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $^ $(TOOLS_LIBS)
#############################################################################