Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Makefiles and libraries for MacOS X #141

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 13 additions & 64 deletions linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,10 @@ BUILD_OBJ_DIR=$(BUILD_DIR)/obj
ARCH=i386
ELF-GC-DYNSTR=./elf-gc-dynstr

ifeq ($(OS),Linux)
CPLUS="g++ -m32"
CPP_LIB:=-L$(shell g++ -m32 -print-file-name=libstdc++.so | xargs dirname) -lstdc++ -ldl -lpthread
endif

ifeq ($(OS),Darwin)
OSXVER := $(shell sw_vers -productVersion)
DEVELOPER_DIR := $(shell /usr/bin/xcode-select -print-path)
ifeq (,$(findstring 10.7, $(OSXVER)))
BUILDING_ON_LION := 0
COMPILER_BIN_DIR := $(DEVELOPER_DIR)/usr/bin
SDK_DIR := $(DEVELOPER_DIR)/SDKs
else
BUILDING_ON_LION := 1
COMPILER_BIN_DIR := $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
SDK_DIR := $(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/SDKs
endif

#SDKROOT ?= $(SDK_DIR)/MacOSX10.6.sdk
SDKROOT ?= $(SDK_DIR)/MacOSX10.8.sdk

ARCH_FLAGS ?= -arch i386 -m32 -march=prescott -gdwarf-2 -g2 -Wno-typedef-redefinition -momit-leaf-frame-pointer -mtune=core2
CPP_LIB=-lstdc++ -lpthread

ifeq ($(origin AR), default)
AR = libtool -static -o
endif
ifeq ($(origin CXX), default)
CPLUS ="$(COMPILER_BIN_DIR)/clang++ -Qunused-arguments -isysroot $(SDKROOT) -mmacosx-version-min=10.5 -fasm-blocks -I$(SDKROOT)/usr/include/malloc $(ARCH_FLAGS)"
endif
LINK ?= $(CXX)
endif
CPLUS="g++ -m32"
CPP_LIB:=-L$(shell g++ -m32 -print-file-name=libstdc++.so | xargs dirname) -lstdc++ -ldl -lpthread


CLINK=$(CPLUS)

Expand All @@ -73,48 +45,25 @@ else
ARCH_CFLAGS_AMD64=-m64 -gdwarf-2 -g2
endif

ifeq ($(OS),Linux)
ARCH_CFLAGS_I486+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_I686+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_AMD+=-march=k6 -mfpmath=387
endif

ifeq ($(OS),Darwin)
# force 387 for FP math so the precision between win32 and linux and osx match
ARCH_CFLAGS_I486+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_I686+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_AMD+=-mfpmath=387
endif

ARCH_CFLAGS_I486+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_I686+=-march=pentium-m -mfpmath=387
ARCH_CFLAGS_AMD+=-march=k6 -mfpmath=387

ARCH_CFLAGS="$(ARCH_CFLAGS_I486)"

BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -DNDEBUG -DPOSIX -D_POSIX -DLINUX -D_LINUX -DGNUC -DNO_MALLOC_OVERRIDE -fno-exceptions -fexpensive-optimizations -Werror=return-type
BASE_CFLAGS+=-w

ifeq ($(OS),Darwin)
BASE_CFLAGS += -DOSX -D_OSX -fvisibility=hidden
else
BASE_CFLAGS+= -DLINUX -D_LINUX
endif
BASE_CFLAGS+= -DLINUX -D_LINUX

ifeq ($(OS),Darwin)
SHLIBEXT=dylib
SHLIBCFLAGS=
ifeq "$(CFG)" "release"
SHLIBLDFLAGS="-shared"
else
SHLIBLDFLAGS="-shared -gdwarf-2 -g2"
endif
SHLIBEXT=so
SHLIBCFLAGS=
ifeq "$(CFG)" "release"
SHLIBLDFLAGS="-shared -Wl,-Map,$@_map.txt"
else
SHLIBEXT=so
SHLIBCFLAGS=
ifeq "$(CFG)" "release"
SHLIBLDFLAGS="-shared -Wl,-Map,$@_map.txt"
else
SHLIBLDFLAGS="-shared -gdwarf-2 -g2 -Wl,-Map,$@_map.txt"
endif
SHLIBLDFLAGS="-shared -gdwarf-2 -g2 -Wl,-Map,$@_map.txt"
endif

AR=ar
LIBEXT=a
MAKE+= -j8
Expand Down
6 changes: 1 addition & 5 deletions linux/Makefile.hl_cdll
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ CFLAGS=$(BASE_CFLAGS) $(ARCH_CFLAGS) -DCLIENT_DLL -DCLIENT_WEAPONS -I/usr/includ

INCLUDEDIRS=-I$(HL_SRC_DIR) -I$(HL_PARTICLEMAN_DIR) -I../dlls -I$(COMMON_SRC_DIR) -I$(PUBLIC_SRC_DIR) -I../pm_shared -I../engine -I../utils/vgui/include -I ../game_shared -I../external

ifeq ($(OS),Darwin)
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -framework Carbon $(CFG)/vgui.dylib -L. -lSDL2-2.0.0
else
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -L$(CFG) vgui.so -L. libSDL2-2.0.so.0
endif
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -L$(CFG) vgui.so -L. libSDL2-2.0.so.0

DO_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) -o $@ -c $<
DO_PUBLIC_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
Expand Down
6 changes: 0 additions & 6 deletions linux/gendbg.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
dsymutil $1
exit 0;
fi

OBJCOPY=objcopy

function usage {
Expand Down
Binary file removed linux/libSDL2-2.0.0.dylib
Binary file not shown.
20 changes: 0 additions & 20 deletions linux/libSDL2-2.0.0.dylib.dSYM/Contents/Info.plist

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion linux/libSDL2.dylib

This file was deleted.