mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Enable building QVMs when cross-compiling
This commit is contained in:
parent
cae7ae9ce6
commit
4f452fcfed
1 changed files with 25 additions and 18 deletions
43
Makefile
43
Makefile
|
@ -549,6 +549,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
|
||||
|
@ -884,19 +888,17 @@ ifneq ($(BUILD_GAME_SO),0)
|
|||
endif
|
||||
|
||||
ifneq ($(BUILD_GAME_QVM),0)
|
||||
ifneq ($(CROSS_COMPILING),1)
|
||||
ifneq ($(BUILD_BASEGAME),0)
|
||||
TARGETS += \
|
||||
ifneq ($(BUILD_BASEGAME),0)
|
||||
TARGETS += \
|
||||
$(B)/$(BASEGAME)/vm/cgame.qvm \
|
||||
$(B)/$(BASEGAME)/vm/qagame.qvm \
|
||||
$(B)/$(BASEGAME)/vm/ui.qvm
|
||||
endif
|
||||
ifneq ($(BUILD_MISSIONPACK),0)
|
||||
TARGETS += \
|
||||
ifneq ($(BUILD_MISSIONPACK),0)
|
||||
TARGETS += \
|
||||
$(B)/$(MISSIONPACK)/vm/qagame.qvm \
|
||||
$(B)/$(MISSIONPACK)/vm/cgame.qvm \
|
||||
$(B)/$(MISSIONPACK)/vm/ui.qvm
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -1227,6 +1229,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=\"\" \
|
||||
|
@ -1241,20 +1248,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 \
|
||||
|
@ -1265,7 +1272,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 \
|
||||
|
@ -1310,7 +1317,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 \
|
||||
|
@ -1329,7 +1336,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 \
|
||||
|
@ -1340,7 +1347,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 $<"
|
||||
|
@ -1392,7 +1399,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)
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
|
Loading…
Reference in a new issue