Advertisement
Guest User

Untitled

a guest
May 8th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. #
  2. # SDK Makefile for x86 Linux
  3. #
  4. #
  5.  
  6. #############################################################################
  7. # Developer configurable items
  8. #############################################################################
  9.  
  10. # the name of the mod binary (_i486.so is appended to the end)
  11. NAME = HPB_bot2
  12.  
  13. # the location of the vcproj that builds the mod
  14. #MOD_PROJ=../game/server/server_hl2mp-2005.vcproj
  15. MOD_PROJ = ../utils/RCBot2_meta/HPB_Bot2.vcproj
  16.  
  17. # the name of the mod configuration (typically <proj name>_<build type><build target>)
  18. #MOD_CONFIG=ServerHL2MP_ReleaseWin32
  19. MOD_CONFIG=HPB_bot2_ReleaseWin32
  20.  
  21. # the directory the base binaries (tier0_i486.so, etc) are located
  22. # this should point to your orange box subfolder of where you have srcds installed.
  23. #GAME_DIR=~/srcds/orangebox
  24. GAME_DIR=/home/steam/tf2
  25. SRCDS_DIR =/home/steam/tf2
  26. # the path to your mods directory
  27. # set this so that 'make install' or 'make installrelease' will copy your binary over automatically.
  28. #MOD_DIR=$(GAME_DIR)/SampleMod
  29. MOD_DIR=$(GAME_DIR)/
  30.  
  31. # compiler options (gcc 3.4.1 will work - 4.2.2 recommended)
  32. #CC=/usr/local/bin/gcc
  33. #CPLUS=/usr/local/bin/g++
  34. #CLINK=/usr/local/bin/gcc
  35. #CPP_LIB="/usr/local/lib/libstdc++.a /usr/local/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_eh.a"
  36. #CC=/usr/bin/gcc
  37. #CPLUS=/usr/bin/g++-4.1
  38. #CLINK=/usr/bin/gcc-4.1
  39. GCC_VER = 4.2
  40. # compiler options (gcc 3.4.1 or above is required - 4.1.2+ recommended)
  41. CC = /usr/bin/gcc-$(GCC_VER)
  42. CPLUS = /usr/bin/gcc-$(GCC_VER)
  43. CLINK = /usr/bin/gcc-$(GCC_VER)
  44. #CPP_LIB_DIR = /usr/lib/gcc/x86_64-linux-gnu/3.4.6/
  45. CPP_LIB="/usr/lib32/libstdc++.so.6.0.19 /usr/lib32/libgcc_s.so.1 -m32"
  46. #CPP_LIB = "libstdc++.a libgcc_eh.a"
  47.  
  48.  
  49. # GCC 4.2.2 optimization flags, if you're using anything below, don't use these!
  50. OPTFLAGS=-O1 -fomit-frame-pointer -ffast-math -fforce-addr -funroll-loops -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -fexpensive-optimizations -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -finline-functions -funswitch-loops -fgcse-after-reload
  51. #OPTFLAGS=-O1 -fomit-frame-pointer -ffast-math -fforce-addr -funroll-loops -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -fexpensive-optimizations -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -finline-functions -funswitch-loops -fgcse-after-reload
  52.  
  53. #OPTFLAGS=
  54.  
  55. # put any compiler flags you want passed here
  56. USER_CFLAGS= -DSE_ORANGEBOXVALVE=4 -DSOURCE_ENGINE=4
  57.  
  58. # Link Libraries
  59. #LIBFILES= \
  60. # $(LIB_DIR)/lib/linux/tier1_486.a \
  61. # $(LIB_DIR)/lib/linux/choreoobjects_486.a \
  62. # $(LIB_DIR)/lib/linux/particles_486.a \
  63. # $(LIB_DIR)/lib/linux/dmxloader_486.a \
  64. # libtier0.so \
  65. # libvstdlib.so \
  66. # libsteam_api.so \
  67. # $(LIB_DIR)/lib/linux/tier3_486.a \
  68. # $(LIB_DIR)/lib/linux/tier2_486.a \
  69. # $(LIB_DIR)/lib/linux/tier1_486.a \
  70. # $(LIB_DIR)/lib/linux/mathlib_486.a \
  71.  
  72.  
  73. # link flags for your mod, make sure to include any special libraries here
  74. #NOTE: YES we want to include the lib files 2 times. We've run into problems with the 1-pass linker not bringing in symbols it should.
  75. #LDFLAGS="-lm -ldl $(LIBFILES) $(LIBFILES)"
  76. LIB_DIR = $(SOURCE_DIR)/lib/linux
  77. LDFLAGS = "-lm -ldl $(LIB_DIR)/particles_i486.a $(LIB_DIR)/dmxloader_i486.a $(LIB_DIR)/mathlib_i486.a $(TIER0_LIB) $(VSTD_LIB) $(LIB_DIR)/tier1_i486.a $(LIB_DIR)/tier2_i486.a $(LIB_DIR)/tier3_i486.a $(LIB_DIR)/choreoobjects_i486.a $(STEAM_LIB)"
  78.  
  79. # XERCES 2.6.0 or above ( [url=http://xml.apache.org/xerces-c/]http://xml.apache.org/xerces-c/[/url] ) is used by the vcproj to makefile converter
  80. # it must be installed before being able to run this makefile
  81. # if you have xerces installed already you should be able to use the two lines below
  82. #XERCES_INC_DIR=/usr/include
  83. #XERCES_LIB_DIR=/usr/lib
  84. XERCES_INC_DIR = /usr/local/src/xerces-c-src_2_6_0/include
  85. XERCES_LIB_DIR = /usr/local/src/xerces-c-src_2_6_0/lib
  86.  
  87. #############################################################################
  88. # Things below here shouldn't need to be altered
  89. #############################################################################
  90. MAKE=make
  91.  
  92. # the dir we want to put binaries we build into
  93. BUILD_DIR=.
  94. # the place to put object files
  95. BUILD_OBJ_DIR=$(BUILD_DIR)/obj
  96.  
  97. # the location of the source code
  98. SOURCE_DIR=..
  99. SRC_DIR =$(SOURCE_DIR)
  100.  
  101. # the CPU target for the build, must be i486 for now
  102. ARCH = i486
  103. ARCH_CFLAGS = -m32 -march=pentium3 -mmmx
  104.  
  105. # -fpermissive is so gcc 3.4.x doesn't complain about some template stuff
  106. BASE_CFLAGS=-DVPROF_LEVEL=1 -DSWDS -D_LINUX -DLINUX -DNDEBUG -fpermissive -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
  107.  
  108. SHLIBEXT=so
  109.  
  110. SHLIBCFLAGS=-fPIC
  111. SHLIBLDFLAGS=-shared -Wl,-Map,$@_map.txt -Wl
  112.  
  113. #flags passed to the compiler
  114. CFLAGS="$(USER_CFLAGS) $(DEFINES) $(ARCH_CFLAGS) $(OPTFLAGS) $(BASE_CFLAGS) -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -Ufopen=dont_use_fopen -UPROTECTED_THINGS_ENABLE -m32"
  115.  
  116. # define list passed to make for the sub makefile
  117. BASE_DEFINES = CC=$(CC) CPLUS=$(CPLUS) CPP_LIB=$(CPP_LIB)\
  118. BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SRC_DIR=$(SRC_DIR) \
  119. LIB_DIR=$(LIB_DIR) SHLIBLDFLAGS=$(SHLIBLDFLAGS) SHLIBEXT=$(SHLIBEXT) \
  120. CLINK=$(CLINK) CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) \
  121. ARCH=$(ARCH) SRCDS_DIR=$(SRCDS_DIR) MOD_CONFIG=$(MOD_CONFIG) NAME=$(NAME) \
  122. XERCES_INC_DIR=$(XERCES_INC_DIR) XERCES_LIB_DIR=$(XERCES_LIB_DIR) \
  123. TIER0_LIB=$(TIER0_LIB) VSTD_LIB=$(VSTD_LIB) SOURCE_DIR=$(SOURCE_DIR) GAME_DIR=$(SRCDS_DIR)
  124.  
  125. # Project Makefile
  126. MAKE_MOD=Makefile.server
  127. MAKE_VCPM=Makefile.vcpm
  128. MAKE_PLUGIN=Makefile.plugin
  129.  
  130. all: check vcpm server
  131.  
  132. check:
  133. if [ -z "$(CC)" ]; then echo "Compiler not defined."; exit; fi
  134. if [ ! -d $(BUILD_DIR) ];then mkdir $(BUILD_DIR);fi
  135. cd $(BUILD_DIR)
  136.  
  137. vcpm:
  138. $(MAKE) -f $(MAKE_VCPM) $(BASE_DEFINES)
  139.  
  140. server: vcpm
  141. if [ ! -f "libtier0.so" ]; then ln -s $(GAME_DIR)/bin/libtier0.so .; fi
  142. if [ ! -f "libvstdlib.so" ]; then ln -s $(GAME_DIR)/bin/libvstdlib.so .; fi
  143. # if [ ! -f "libsteam_api.so" ]; then ln -s $(GAME_DIR)/bin/libsteam_api.so .; fi
  144. # When running over samba we need to copy the files because symlinking isn't possible.
  145. # cp -f $(GAME_DIR)/bin/tier0_i486.so .
  146. # cp -f $(GAME_DIR)/bin/vstdlib_i486.so .
  147. # cp -f $(GAME_DIR)/bin/steam_api_i486.so .
  148.  
  149. ./vcpm $(MOD_PROJ)
  150. $(MAKE) -f $(MAKE_MOD) $(BASE_DEFINES)
  151.  
  152. plugin:
  153. $(MAKE) -f $(MAKE_PLUGIN) $(BASE_DEFINES)
  154.  
  155. clean:
  156. $(MAKE) -f $(MAKE_VCPM) $(BASE_DEFINES) clean
  157. $(MAKE) -f $(MAKE_PLUGIN) $(BASE_DEFINES) clean
  158. $(MAKE) -f $(MAKE_MOD) $(BASE_DEFINES) clean
  159.  
  160. install:
  161. cp -f $(NAME)_$(ARCH).so $(MOD_DIR)/bin/$(NAME)_$(ARCH).so
  162.  
  163. installrelease:
  164. cp -f $(NAME)_$(ARCH).so $(MOD_DIR)/bin/$(NAME)_$(ARCH).so
  165. strip $(MOD_DIR)/bin/$(NAME)_$(ARCH).so
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement