mirror of
https://github.com/shawns-valve/halflife.git
synced 2024-11-24 05:01:03 +00:00
Updated Linux makefiles
- Remove USE_STEAM_RUNTIME checks -- assume we're running in the Steam Runtime "scout" environment - Remove VALVE_NO_AUTO_P4 checks -- assume we're not in a Perforce depot - Add check for CREATE_OUTPUT_DIRS environment variable, which will automatically create the output directory structure - Remove validator.o from the Half-Life client Makefile, as the corresponding source file is no longer present in the SDK
This commit is contained in:
parent
33ae00e417
commit
536998dfb5
9 changed files with 56 additions and 58 deletions
|
@ -64,4 +64,4 @@ Visual Studio 2019 is required to build mod DLLs on Windows. In the Visual Studi
|
|||
|
||||
Tools have not yet been updated for VS2019, but can be built using the VS2010 projects in the `projects\vs2010` folder. See the `readme.txt` file there.
|
||||
|
||||
Linux binaries are built using Makefiles found in the `linux` folder, and are expected to be built / run in the Steam Runtime "scout" environment. You will need to set the environment variables VALVE_NO_AUTO_P4=1 and USE_STEAM_RUNTIME=1 while building.
|
||||
Linux binaries can be built using Makefiles found in the `linux` folder. They expect to be built / run in the Steam Runtime "scout" environment. The built binaries are copied to a directory called "game" at the same level as the root directory for the git repository. You can set CREATE_OUTPUT_DIRS=1 while building to create the output directory structure automatically.
|
||||
|
|
|
@ -25,34 +25,21 @@ DBG_SRC_DIR=$(SOURCE_DIR)/dbg
|
|||
|
||||
BUILD_OBJ_DIR=$(BUILD_DIR)/obj
|
||||
|
||||
ifneq "$(origin VALVE_NO_AUTO_P4)" "undefined"
|
||||
P4_EDIT_START = chmod -R +w
|
||||
P4_EDIT_END = || true
|
||||
P4_REVERT_START = true
|
||||
P4_REVERT_END =
|
||||
else
|
||||
P4_EDIT_START = p4 edit
|
||||
P4_EDIT_END =
|
||||
P4_REVERT_START = p4 revert
|
||||
P4_REVERT_END =
|
||||
endif
|
||||
|
||||
ARCH=i386
|
||||
ELF-GC-DYNSTR=./elf-gc-dynstr
|
||||
|
||||
# Note that we expect to be building inside a Steam Runtime "scout" container
|
||||
ifeq ($(OS),Linux)
|
||||
ifneq ($(USE_STEAM_RUNTIME),1)
|
||||
CC="/valve/bin/gcc-4.6 -m32"
|
||||
CPLUS="/valve/bin/g++-4.6 -m32"
|
||||
CPP_LIB:=-L$(shell /valve/bin/g++-4.6 -m32 -print-file-name=libstdc++.so | xargs dirname) -lstdc++ -ldl -lpthread
|
||||
CLINK=$(CC)
|
||||
else
|
||||
CC="gcc-5 -m32 -std=gnu++11 -fno-delete-null-pointer-checks -fno-gnu-unique -fvisibility=hidden"
|
||||
CPLUS="g++-5 -m32 -std=gnu++11 -fno-delete-null-pointer-checks -fno-gnu-unique -fvisibility=hidden"
|
||||
CPP_LIB:=-L$(shell g++-5 -m32 -print-file-name=libstdc++.so | xargs dirname) -lstdc++ -ldl -lpthread
|
||||
CLINK=$(CC)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
OSXVER := $(shell sw_vers -productVersion)
|
||||
|
|
|
@ -12,6 +12,7 @@ PUBLIC_OBJ_DIR=$(DMC_OBJ_DIR)/public
|
|||
COMMON_OBJ_DIR=$(DMC_OBJ_DIR)/common
|
||||
GAME_SHARED_OBJ_DIR=$(DMC_OBJ_DIR)/game_shared
|
||||
PM_SHARED_OBJ_DIR=$(DMC_OBJ_DIR)/pm_shared
|
||||
DMC_OUTPUT_DIR=$(SOURCE_DIR)/../game/dmc
|
||||
|
||||
CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) -DCLIENT_DLL -DDMC_BUILD -I/usr/include/malloc -D_snwprintf=swprintf \
|
||||
-DDISABLE_JUMP_ORIGIN -DDISABLE_VEC_ORIGIN -D_MAX_PATH=PATH_MAX
|
||||
|
@ -115,9 +116,12 @@ all: client_dmc.$(SHLIBEXT)
|
|||
|
||||
client_dmc.$(SHLIBEXT): $(DMC_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(PM_SHARED_OBJS)
|
||||
$(CLINK) -o $(BUILD_DIR)/$@ $(DMC_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(PM_SHARED_OBJS) $(LDFLAGS) $(CPP_LIB)
|
||||
$(P4_EDIT_START) ../../game/dmc/cl_dlls/client.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/dmc/cl_dlls/client.$(SHLIBEXT)
|
||||
./gendbg.sh ../../game/dmc/cl_dlls/client.$(SHLIBEXT)
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(DMC_OUTPUT_DIR)/cl_dlls
|
||||
endif
|
||||
$(P4_EDIT_START) $(DMC_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ $(DMC_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT)
|
||||
./gendbg.sh $(DMC_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT)
|
||||
|
||||
|
||||
$(DMC_OBJ_DIR):
|
||||
|
|
|
@ -11,6 +11,7 @@ PM_SRC_DIR=$(SOURCE_DIR)/dmc/pm_shared
|
|||
DMCDLL_OBJ_DIR=$(BUILD_OBJ_DIR)/dmcdll
|
||||
PM_OBJ_DIR=$(DMCDLL_OBJ_DIR)/pm_shared
|
||||
GAME_SHARED_OBJ_DIR=$(DMCDLL_OBJ_DIR)/game_shared
|
||||
DMC_OUTPUT_DIR=$(SOURCE_DIR)/../game/dmc
|
||||
|
||||
#full optimization
|
||||
CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS)
|
||||
|
@ -93,9 +94,12 @@ dirs:
|
|||
|
||||
dmc.$(SHLIBEXT): $(DMCDLL_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS)
|
||||
$(CLINK) $(SHLIBLDFLAGS) -o $(BUILD_DIR)/$@ $(DMCDLL_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS) $(LDFLAGS) $(CPP_LIB)
|
||||
$(P4_EDIT_START) ../../game/dmc/dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/dmc/dlls
|
||||
./gendbg.sh ../../game/dmc/dlls/dmc.$(SHLIBEXT)
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(DMC_OUTPUT_DIR)/dlls
|
||||
endif
|
||||
$(P4_EDIT_START) .$(DMC_OUTPUT_DIR)/dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ $(DMC_OUTPUT_DIR)/dlls
|
||||
./gendbg.sh $(DMC_OUTPUT_DIR)/dlls/dmc.$(SHLIBEXT)
|
||||
|
||||
$(DMCDLL_OBJ_DIR)/%.o : $(DMCDLL_SRC_DIR)/%.cpp
|
||||
$(DO_DMCDLL_CC)
|
||||
|
|
|
@ -14,6 +14,7 @@ COMMON_OBJ_DIR=$(HL1_OBJ_DIR)/common
|
|||
GAME_SHARED_OBJ_DIR=$(HL1_OBJ_DIR)/game_shared
|
||||
HL1_SERVER_OBJ_DIR=$(HL1_OBJ_DIR)/server
|
||||
PM_SHARED_OBJ_DIR=$(HL1_OBJ_DIR)/pm_shared
|
||||
HL_OUTPUT_DIR=$(SOURCE_DIR)/../game/valve
|
||||
|
||||
CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) -DCLIENT_DLL -DCLIENT_WEAPONS -DHL_DLL -I/usr/include/malloc -D_snwprintf=swprintf \
|
||||
-DDISABLE_JUMP_ORIGIN -DDISABLE_VEC_ORIGIN
|
||||
|
@ -114,7 +115,6 @@ PUBLIC_OBJS = \
|
|||
$(PUBLIC_OBJ_DIR)/interface.o \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$(COMMON_OBJ_DIR)/validator.o \
|
||||
$(COMMON_OBJ_DIR)/parsemsg.o \
|
||||
|
||||
GAME_SHARED_OBJS = \
|
||||
|
@ -138,9 +138,12 @@ all: client.$(SHLIBEXT)
|
|||
|
||||
client.$(SHLIBEXT): $(HL1_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(DLL_OBJS) $(PM_SHARED_OBJS)
|
||||
$(CLINK) -o $(BUILD_DIR)/$@ $(HL1_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(DLL_OBJS) $(PM_SHARED_OBJS) $(LDFLAGS) $(CPP_LIB)
|
||||
$(P4_EDIT_START) ../../game/valve/cl_dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/valve/cl_dlls
|
||||
./gendbg.sh ../../game/valve/cl_dlls/client.$(SHLIBEXT)
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(HL_OUTPUT_DIR)/cl_dlls
|
||||
endif
|
||||
$(P4_EDIT_START) $(HL_OUTPUT_DIR)/cl_dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ $(HL_OUTPUT_DIR)/cl_dlls
|
||||
./gendbg.sh $(HL_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT)
|
||||
|
||||
$(HL1_OBJ_DIR):
|
||||
mkdir -p $(HL1_OBJ_DIR)
|
||||
|
|
|
@ -11,6 +11,7 @@ HLDLL_OBJ_DIR=$(BUILD_OBJ_DIR)/hldll
|
|||
HLWPN_OBJ_DIR=$(HLDLL_OBJ_DIR)/wpn_shared
|
||||
PM_OBJ_DIR=$(HLDLL_OBJ_DIR)/pm_shared
|
||||
GAME_SHARED_OBJ_DIR=$(HLDLL_OBJ_DIR)/game_shared
|
||||
HL_OUTPUT_DIR=$(SOURCE_DIR)/../game/valve
|
||||
|
||||
#CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) $(SHLIBCFLAGS) -DCLIENT_WEAPONS
|
||||
CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) -DCLIENT_WEAPONS
|
||||
|
@ -152,9 +153,12 @@ dirs:
|
|||
|
||||
hl.$(SHLIBEXT): $(HLDLL_OBJS) $(HLWPN_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS)
|
||||
$(CC) $(LDFLAGS) $(SHLIBLDFLAGS) -o $(BUILD_DIR)/$@ $(HLDLL_OBJS) $(HLWPN_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS)
|
||||
$(P4_EDIT_START) ../../game/valve/dlls/hl.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/valve/dlls/hl.$(SHLIBEXT)
|
||||
./gendbg.sh ../../game/valve/dlls/hl.$(SHLIBEXT)
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(HL_OUTPUT_DIR)/dlls
|
||||
endif
|
||||
$(P4_EDIT_START) $(HL_OUTPUT_DIR)/dlls/hl.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp -f $(BUILD_DIR)/$@ $(HL_OUTPUT_DIR)/dlls/hl.$(SHLIBEXT)
|
||||
./gendbg.sh $(HL_OUTPUT_DIR)/dlls/hl.$(SHLIBEXT)
|
||||
|
||||
$(HLWPN_OBJ_DIR)/%.o : $(HLWPN_SRC_DIR)/%.cpp
|
||||
$(DO_HLWPN_CC)
|
||||
|
|
|
@ -12,6 +12,7 @@ PUBLIC_OBJ_DIR=$(RICOCHET_OBJ_DIR)/public
|
|||
COMMON_OBJ_DIR=$(RICOCHET_OBJ_DIR)/common
|
||||
GAME_SHARED_OBJ_DIR=$(RICOCHET_OBJ_DIR)/game_shared
|
||||
PM_SHARED_OBJ_DIR=$(RICOCHET_OBJ_DIR)/pm_shared
|
||||
RICOCHET_OUTPUT_DIR=$(SOURCE_DIR)/../game/ricochet
|
||||
|
||||
CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) -DCLIENT_DLL -I/usr/include/malloc -D_snwprintf=swprintf \
|
||||
-DDISABLE_JUMP_ORIGIN -DDISABLE_VEC_ORIGIN -D_MAX_PATH=PATH_MAX
|
||||
|
@ -114,9 +115,12 @@ all: client_ricochet.$(SHLIBEXT)
|
|||
|
||||
client_ricochet.$(SHLIBEXT): $(RICOCHET_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(PM_SHARED_OBJS)
|
||||
$(CLINK) -o $(BUILD_DIR)/$@ $(RICOCHET_OBJS) $(PUBLIC_OBJS) $(COMMON_OBJS) $(GAME_SHARED_OBJS) $(PM_SHARED_OBJS) $(LDFLAGS) $(CPP_LIB)
|
||||
$(P4_EDIT_START) ../../game/ricochet/cl_dlls/client.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/ricochet/cl_dlls/client.$(SHLIBEXT)
|
||||
./gendbg.sh ../../game/ricochet/cl_dlls/client.$(SHLIBEXT)
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(RICOCHET_OUTPUT_DIR)/cl_dlls
|
||||
endif
|
||||
$(P4_EDIT_START) $(RICOCHET_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT) $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ $(RICOCHET_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT)
|
||||
./gendbg.sh $(RICOCHET_OUTPUT_DIR)/cl_dlls/client.$(SHLIBEXT)
|
||||
|
||||
$(RICOCHET_OBJ_DIR):
|
||||
mkdir -p $(RICOCHET_OBJ_DIR)
|
||||
|
|
|
@ -13,6 +13,7 @@ RICOCHETDLL_OBJ_DIR=$(BUILD_OBJ_DIR)/ricochetdll
|
|||
RICOCHETWPN_OBJ_DIR=$(RICOCHETDLL_OBJ_DIR)/wpn_shared
|
||||
PM_OBJ_DIR=$(RICOCHETDLL_OBJ_DIR)/pm_shared
|
||||
GAME_SHARED_OBJ_DIR=$(RICOCHETDLL_OBJ_DIR)/game_shared
|
||||
RICOCHET_OUTPUT_DIR=$(SOURCE_DIR)/../game/ricochet
|
||||
|
||||
#CFLAGS=$(BASE_CFLAGS) -g
|
||||
CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -fno-strength-reduce
|
||||
|
@ -102,9 +103,12 @@ dirs:
|
|||
|
||||
ricochet.$(SHLIBEXT): $(RICOCHETDLL_OBJS) $(RICOCHETWPN_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS)
|
||||
$(CLINK) $(SHLIBLDFLAGS) -o $(BUILD_DIR)/$@ $(RICOCHETDLL_OBJS) $(RICOCHETWPN_OBJS) $(PM_OBJS) $(GAME_SHARED_OBJS) $(LDFLAGS) $(CPP_LIB)
|
||||
$(P4_EDIT_START) ../../game/ricochet/dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ ../../game/ricochet/dlls
|
||||
./gendbg.sh ../../game/ricochet/dlls/$@
|
||||
ifeq ($(CREATE_OUTPUT_DIRS),1)
|
||||
mkdir -p $(RICOCHET_OUTPUT_DIR)/dlls
|
||||
endif
|
||||
$(P4_EDIT_START) $(RICOCHET_OUTPUT_DIR)/dlls/$@ $(P4_EDIT_END)
|
||||
cp $(BUILD_DIR)/$@ $(RICOCHET_OUTPUT_DIR)/dlls
|
||||
./gendbg.sh $(RICOCHET_OUTPUT_DIR)/dlls/$@
|
||||
|
||||
$(RICOCHETWPN_OBJ_DIR)/%.o : $(RICOCHETWPN_SRC_DIR)/%.cpp
|
||||
$(DO_RICOCHETWPN_CC)
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -n "$VALVE_NO_AUTO_P4" ]]; then
|
||||
|
||||
p4_edit () {
|
||||
chmod -R +w "$@" || true
|
||||
}
|
||||
p4_revert () {
|
||||
true
|
||||
}
|
||||
else
|
||||
p4_edit () {
|
||||
p4 edit "$@"
|
||||
}
|
||||
p4_revert () {
|
||||
p4 revert "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
UNAME=$(uname)
|
||||
if [ "$UNAME" == "Darwin" ]; then
|
||||
|
@ -24,11 +16,7 @@ if [ "$UNAME" == "Darwin" ]; then
|
|||
exit 0;
|
||||
fi
|
||||
|
||||
if [[ -z "$USE_STEAM_RUNTIME" ]]; then
|
||||
OBJCOPY=/valve/bin/objcopy
|
||||
else
|
||||
OBJCOPY=objcopy
|
||||
fi
|
||||
|
||||
function usage {
|
||||
echo "$0 /path/to/input/file [-o /path/to/output/file ]"
|
||||
|
|
Loading…
Reference in a new issue