Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.6 KiB

  1. #
  2. # SDK Makefile for x86 Linux
  3. #
  4. #
  5. #############################################################################
  6. # Developer configurable items
  7. #############################################################################
  8. # the name of the mod binary (_i486.so is appended to the end)
  9. NAME=server
  10. # the location of the vcproj that builds the mod
  11. MOD_PROJ=../dlls/hl_sdk.vcproj
  12. # the name of the mod configuration (typically <proj name>_<build type><build target>)
  13. MOD_CONFIG=hl_ReleaseSDKWin32
  14. # the directory the base binaries (tier0_i486.so, etc) are located
  15. #GAME_DIR=../../
  16. GAME_DIR=~/valve/hl2bin/
  17. # compiler options (gcc 3.4.1 or above is required)
  18. CC=/usr/local/bin/gcc
  19. CPLUS=/usr/local/bin/g++
  20. CLINK=/usr/local/bin/gcc
  21. CPP_LIB="/usr/local/lib/libstdc++.a /usr/local/lib/libgcc_eh.a"
  22. # put any compiler flags you want passed here
  23. USER_CFLAGS=
  24. # link flags for your mod, make sure to include any special libraries here
  25. LDFLAGS="-lm -ldl $(GAME_DIR)/bin/tier0_i486.so $(GAME_DIR)/bin/vstdlib_i486.so"
  26. # XERCES 2.6.0 or above ( http://xml.apache.org/xerces-c/ ) is used by the vcproj to makefile converter
  27. # it must be installed before being able to run this makefile
  28. XERCES_INC_DIR=/home/alfred/tmp/xerces-c-src_2_6_0/include
  29. XERCES_LIB_DIR=/home/alfred/tmp/xerces-c-src_2_6_0/lib
  30. # if you have xerces installed already you should be able to use the two lines below
  31. #XERCES_INC_DIR=/usr/include
  32. #XERCES_LIB_DIR=/usr/lib
  33. #############################################################################
  34. # Things below here shouldn't need to be altered
  35. #############################################################################
  36. MAKE=make
  37. # the dir we want to put binaries we build into
  38. BUILD_DIR=.
  39. # the place to put object files
  40. BUILD_OBJ_DIR=$(BUILD_DIR)/obj
  41. # the location of the source code
  42. SOURCE_DIR=..
  43. # the CPU target for the build, must be i486 for now
  44. ARCH=i486
  45. ARCH_CFLAGS=-mtune=i686 -march=pentium3 -mmmx -O3
  46. # -fpermissive is so gcc 3.4.x doesn't complain about some template stuff
  47. BASE_CFLAGS=-fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
  48. SHLIBEXT=so
  49. SHLIBCFLAGS=-fPIC
  50. SHLIBLDFLAGS=-shared -Wl,-Map,$@_map.txt -Wl
  51. #flags passed to the c compiler
  52. CFLAGS="$(USER_CFLAGS) $(DEFINES) $(ARCH_CFLAGS) $(BASE_CFLAGS) -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE"
  53. # define list passed to make for the sub makefile
  54. BASE_DEFINES=CC=$(CC) CPLUS=$(CPLUS) CPP_LIB=$(CPP_LIB) \
  55. BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) \
  56. SOURCE_DIR=$(SOURCE_DIR) SHLIBLDFLAGS=$(SHLIBLDFLAGS) SHLIBEXT=$(SHLIBEXT) \
  57. CLINK=$(CLINK) CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) \
  58. ARCH=$(ARCH) GAME_DIR=$(GAME_DIR) MOD_CONFIG=$(MOD_CONFIG) NAME=$(NAME) \
  59. XERCES_INC_DIR=$(XERCES_INC_DIR) XERCES_LIB_DIR=$(XERCES_LIB_DIR)
  60. # Project Makefile
  61. MAKE_MOD=Makefile.mod
  62. MAKE_VCPM=Makefile.vcpm
  63. MAKE_PLUGIN=Makefile.plugin
  64. all: check vcpm mod
  65. check:
  66. if [ -z "$(CC)" ]; then echo "Compiler not defined."; exit; fi
  67. if [ ! -d $(BUILD_DIR) ];then mkdir $(BUILD_DIR);fi
  68. cd $(BUILD_DIR)
  69. vcpm:
  70. $(MAKE) -f $(MAKE_VCPM) $(BASE_DEFINES)
  71. mod: vcpm
  72. if [ ! -f "tier0_i486.so" ]; then ln -s $(GAME_DIR)/bin/tier0_i486.so .; fi
  73. if [ ! -f "vstdlib_i486.so" ]; then ln -s $(GAME_DIR)/bin/vstdlib_i486.so .; fi
  74. ./vcpm $(MOD_PROJ)
  75. $(MAKE) -f $(MAKE_MOD) $(BASE_DEFINES)
  76. plugin:
  77. $(MAKE) -f $(MAKE_PLUGIN) $(BASE_DEFINES)
  78. clean:
  79. $(MAKE) -f $(MAKE_VCPM) $(BASE_DEFINES) clean
  80. $(MAKE) -f $(MAKE_PLUGIN) $(BASE_DEFINES) clean
  81. $(MAKE) -f $(MAKE_MOD) $(BASE_DEFINES) clean