Advertisement
Guest User

sample makefile for compiling BSP maps (Source Engine)

a guest
Mar 2nd, 2014
461
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.73 KB | None
  1.  
  2. .PHONY: auto full retail clean compile convert run install install_retail set run run_retail uninstall uninstall_retail del_log clear help
  3.  
  4. # vars
  5.  
  6. CD = C:\Lite Thread\_bssdk\hl2
  7. INSTALL = D:\TempGames\Half-Life 2\hl2\maps
  8. MAP = background05a
  9. WIDTH = 1200
  10. HEIGHT = 900
  11. MODE = windowed
  12.  
  13. # macros
  14.  
  15. auto: help
  16. full: set del_log run
  17. retail: set del_log run_retail
  18. clean: del_log clear
  19.  
  20. compile: $(MAP).bsp
  21. convert: $(MAP)_retail.bsp
  22. install: ..\hl2\maps\$(MAP).bsp
  23. install_retail: $(INSTALL)\$(MAP).bsp
  24.  
  25. # targets
  26.  
  27. $(MAP).bsp: $(MAP).vmf
  28.     vbsp -low $(MAP)
  29.     vvis -low $(MAP)
  30.     vrad -extra -low $(MAP)
  31.  
  32. $(MAP)_retail.bsp: $(MAP).bsp
  33.     bspconv $(MAP).bsp $(MAP)_retail.bsp
  34.  
  35. ..\hl2\maps\$(MAP).bsp: $(MAP).bsp
  36.     copy $(MAP).bsp ..\hl2\maps\$(MAP).bsp
  37.  
  38. $(INSTALL)\$(MAP).bsp: $(MAP)_retail.bsp
  39.     copy $(MAP)_retail.bsp "$(INSTALL)\$(MAP).bsp"
  40.  
  41. # commands
  42.  
  43. set:
  44.     setx VProject "$(CD)"
  45.  
  46. run: ..\hl2\maps\$(MAP).bsp
  47.     ..\hl2.exe -dx9 -$(MODE) -width $(WIDTH) -height $(HEIGHT) -heapsize 524288 +cl_showfps 2 +map $(MAP)
  48.  
  49. run_retail: $(INSTALL)\$(MAP).bsp
  50.     $(INSTALL)\..\..\hl2.exe -steam -$(MODE) -width $(WIDTH) -height $(HEIGHT) +cl_showfps 2 +map $(MAP)
  51.  
  52. uninstall:
  53.     if exist ..\hl2\maps\$(MAP).bsp del ..\hl2\maps\$(MAP).bsp
  54.  
  55. uninstall_retail:
  56.     if exist "$(INSTALL)\$(MAP).bsp" del "$(INSTALL)\$(MAP).bsp"
  57.  
  58. del_log:
  59.     if exist $(MAP).log del /Q /F $(MAP).log
  60.  
  61. clear:
  62.     if exist $(MAP).prt del /Q /F $(MAP).prt
  63.     if exist $(MAP).bsp del /Q /F $(MAP).bsp
  64.     if exist $(MAP)_retail.bsp del /Q /F $(MAP)_retail.bsp
  65.  
  66. help:
  67.     :
  68.     : make full
  69.     : make retail
  70.     : make clean
  71.     : make run
  72.     : make run_retail
  73.     : make compile
  74.     : make convert
  75.     : make install
  76.     : make uninstall
  77.     : make install_retail
  78.     : make uninstall_retail
  79.     :
Advertisement
RAW Paste Data Copied
Advertisement