Commit 37639735 authored by dylan grafmyre's avatar dylan grafmyre
Browse files

snap

parent c2954993
......@@ -2,9 +2,9 @@
GAME?=hl2.exe
PYTHON_BIN?=./env/scripts/python
GARYSMOD_DIR?=D:\\Steam\\steamapps\\common\\GarrysMod\\
VBIN_DIR?=$(GARYSMOD_DIR)bin\\
MOD_DIR?=$(GARYSMOD_DIR)garrysmod\\
GAME_DIR?=D:\\Steam\\steamapps\\common\\GarrysMod\\
VBIN_DIR?=$(GAME_DIR)bin\\
MOD_DIR?=$(GAME_DIR)garrysmod\\
MOUNT_DIR?=.\\
VBIN_FLAGS?=-game $(MOD_DIR)
......@@ -37,7 +37,6 @@ J2_FLAGS?=
$(BSP_BIN) $(BSP_FLAGS) $(basename $^)
$(VIS_BIN) $(VIS_FLAGS) $(basename $^)
$(RAD_BIN) $(RAD_FLAGS) $(basename $^)
cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
%.prt: %.bsp
@test -f $@ || rm -f $(basename $@).bsp
......@@ -59,7 +58,7 @@ all: ttt_terrorcon_v2.bsp ttt_terrorcon_v2.lint ttt_terrorcon_v2.game
ifeq ($(GAME),0)
echo user disabled run game via GAME=0
else
$(GARYSMOD_DIR)$(GAME) -allowdebug $(VBIN_FLAGS) +map $(notdir $(basename $^)) +gamemode terrortown +ttt_debug_preventwin 1 +ttt_preptime_seconds 10 +ttt_minimum_players 1
$(GAME_DIR)$(GAME) -allowdebug $(VBIN_FLAGS) +map $(notdir $(basename $^)) +gamemode terrortown +ttt_debug_preventwin 1 +ttt_preptime_seconds 10 +ttt_minimum_players 1
endif
install: ttt_terrorcon_v2_hdr_final_p.bsp
......@@ -68,6 +67,8 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
%.lint: %.bspzip-addlist
$(PYTHON_BIN) ./contrib/bspzip-lint $^ 2>&1 | tee $@
maps/%.bsp: %.bsp
cp $^ $@
# hammer default flags
%_default.bsp: %.vmf
......@@ -76,7 +77,6 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
$(VIS_BIN) $(VBIN_FLAGS) $(basename $^)
$(RAD_BIN) $(VBIN_FLAGS) $(basename $^)
mv $(@:_default.bsp=.bsp) $@
cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
$(GEN_BSPZIP_ADDLIST_BIN) $(GEN_BSPZIP_ADDLIST_FLAGS) $^ > $(@:.bsp=.bspzip-addlist)
%_fast.bsp: %.vmf
......@@ -85,7 +85,6 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
$(VIS_BIN) -fast $(VBIN_FLAGS) $(basename $^)
$(RAD_BIN) -bounce 2 -noextra $(VBIN_FLAGS) $(basename $^)
mv $(@:_fast.bsp=.bsp) $@
cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
$(GEN_BSPZIP_ADDLIST_BIN) $(GEN_BSPZIP_ADDLIST_FLAGS) $^ > $(@:.bsp=.bspzip-addlist)
%_hdr.bsp: %.vmf
......@@ -94,7 +93,6 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
$(VIS_BIN) $(VBIN_FLAGS) $(basename $^)
$(RAD_BIN) -both $(VBIN_FLAGS) $(basename $^)
mv $(@:_hdr.bsp=.bsp) $@
cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
$(GEN_BSPZIP_ADDLIST_BIN) $(GEN_BSPZIP_ADDLIST_FLAGS) $^ > $(@:.bsp=.bspzip-addlist)
%_hdr_final.bsp: %.vmf
......@@ -103,7 +101,6 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
$(VIS_BIN) $(VBIN_FLAGS) $(basename $^)
$(RAD_BIN) -both -final $(VBIN_FLAGS) $(basename $^)
mv $(@:_hdr_final.bsp=.bsp) $@
cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
$(GEN_BSPZIP_ADDLIST_BIN) $(GEN_BSPZIP_ADDLIST_FLAGS) $^ > $(@:.bsp=.bspzip-addlist)
# only ents works on an existing bsp,
......@@ -112,18 +109,34 @@ install: ttt_terrorcon_v2_hdr_final_p.bsp
# # only-ents
# $(BSP_BIN) -onlyents $(VBIN_FLAGS) $(basename $^)
# mv $(@:_ents.bsp=.bsp) $@
# cp $@ $(MOUNT_DIR)maps\\$(notdir $@)
%.gma: %.bsp
# create gma files for publishing
# testing requirest then extracting the gma and mounting it via
# Garrysmod/garrysmod/cfg/mount.cfg
#
#$(J2_BIN) $(J2_FLAGS) <addons-src/512x512.vmt.j2 $(basename $^).vmt >addons-src/materials/vgui/maps/menu_thumb_$(basename $^).vmt
#$(J2_BIN) $(J2_FLAGS) <addons-src/maps/template.res.j2 $(basename $^) >addons-src/maps/$(basename $^).res
#cp addons-src/512x512.vtf addons-src/materials/vgui/maps/menu_thumb_$(basename $^).vtf
#cp addons-src/128x128.png addons-src/maps/thumb/$(basename $^).png
# addons-src/maps/*.res
# addons-src/materials/vgui/maps/*.vmt
# addons-src/materials/vgui/maps/*.vtf
addons/%.gma: %.bsp addons-src/addon.json Makefile
rm -rv \
addons-src/maps/*.bsp \
addons-src/materials/vgui/maps/*.vmt \
addons-src/materials/vgui/maps/*.vtf \
addons-src/maps/thumb/*.png \
|| true
cp $^ addons-src/maps/
$(J2_BIN) $(J2_FLAGS) <addons-src/512x512.vmt.j2 $(basename $^).vmt >addons-src/materials/vgui/maps/menu_thumb_$(basename $^).vmt
cp addons-src/512x512.vtf addons-src/materials/vgui/maps/menu_thumb_$(basename $^).vtf
$(GMAD_BIN) $(GMAD_FLAGS) create -folder "addons-src" -out "addons/$@"
cp $(word 1, $^) addons-src/maps/
cp addons-src/128x128.png addons-src/maps/thumb/$(basename $(word 1, $^)).png
$(GMAD_BIN) $(GMAD_FLAGS) create -folder "addons-src" -out "$@"
# garrysmod refuses to load gma files untill after thier published and live
# so no use trying to test them
#.PHONY: install-addons
#
#install-addons:
# cp -var addons/*.gma $(MOD_DIR)/addons/
publish: addons/ttt_terrorcon_v2_hdr_final_p.gma
$(GMPUBLISH_BIN) $(GMPUBLISH_FLAGS) create -addon "$^" -icon "addons/512x512.jpg"
......
......@@ -5,8 +5,9 @@
"ignore" :
[
"*.git-keep",
"512x512.jpg",
"512x512.vmt.j2",
"512x512.jpeg",
"128x128.png",
"*.j2",
"512x512.vtf",
"*.swp"
]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment