forked from Arkhist/Hacknet-Pathfinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (54 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
ifeq ($(OS),Windows_NT)
NFVERSION=v4.0.30319## Net Framework version
NFDIR = $(WINDIR)\Microsoft.NET\Framework\
NFDIR = $(WINDIR)\Microsoft.NET\Framework\$(NFVERSION)
NFOPT = /p:Configuration=Release
PROGRAMFILES := $(if ${ProgramFiles(x86)},${ProgramFiles(x86)},${ProgramFiles})
HACKNETDIR=$(PROGRAMFILES)\Steam\steamapps\common\Hacknet## Hacknet installation dir
else
NFBUILD = xbuild
NFOPT = /p:Configuration=Release /p:TargetFrameworkVersion="v4.5"
HACKNETDIR=/home/$(USER)/.steam/steam/steamapps/common/Hacknet
endif
.ONESHELL:
.SILENT:
.PHONY: help clean
build: lib/HacknetPathfinder.exe ## make all targets
clean: ## clean all targets
rm lib/HacknetPathfinder.exe
rm lib/PathfinderPatcher.exe
rm bin/Release/Pathfinder.dll
help: ## this help information
@echo
echo $(MAKE) [targets ...] [parameters=value ...]
echo
echo targets:
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST)\
| awk 'BEGIN {FS = ":.*?## "}; {printf " %-16s %s\n", $$1, $$2}'
echo
echo parameters:
grep -E '^ *[a-zA-Z_-]+\=.*?## .*$$' $(MAKEFILE_LIST)\
| awk 'BEGIN {FS = "=.*?## "}; {gsub(/^[ \t]+/, "", $$1);gsub(/^[ \t]+/, "", $$2); printf " %-16s %s\n", $$1, $$2}'
echo
lib/HacknetPathfinder.exe: lib/PathfinderPatcher.exe bin/Release/Pathfinder.dll $(HACKNETDIR)/Hacknet.exe
cd lib
PathfinderPatcher.exe -pathfinderDir "../bin/Release" -exeDir "$(HACKNETDIR)"
cd ..
bin/Release/Pathfinder.dll: lib/PathfinderPatcher.exe $(HACKNETDIR)/Hacknet.exe
cd lib
PathfinderPatcher.exe -exeDir "$(HACKNETDIR)" -spit
$(NFBUILD) ../Pathfinder.csproj $(NFOPT)
cd ..
lib/PathfinderPatcher.exe:
cd lib
echo "DO : '$(NFBUILD) ../PathfinderPatcher/PathfinderPatcher.csproj $(NFOPT)'"
$(NFBUILD) ../PathfinderPatcher/PathfinderPatcher.csproj $(NFOPT)
cd ..
$(HACKNETDIR)/Hacknet.exe: #~
$(MAKE) help
echo 'hint:'
echo ' add HACKNETDIR="<Direcory where Hacknet is installed>" in the $(MAKE) command.'
echo
echo 'FATAL: $(HACKNETDIR)/Hacknet.exe not found'
echo
exit 127