forked from adrenalynn/AutoPoints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
46 lines (34 loc) · 1.46 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
# variables
modname = PointCapAlert
dllname = $(modname).dll
version = $(shell cat modInfo.json | awk '/"version"/ {print $$3}' | head -1 | sed 's/[",]//g')
zipname = $(modname)-$(version).zip
zip_files_extra = *.json
builddir = $(modname)
gamedir = /local/games/Steam/steamapps/common/Colony\ Survival
libdir = $(gamedir)/colonyserver_Data/Managed
$(dllname): src/*.cs
mcs /target:library -nostdlib -r:$(libdir)/Assembly-CSharp.dll,$(libdir)/UnityEngine.CoreModule.dll,$(libdir)/UnityEngine.TextRenderingModule,$(libdir)/mscorlib.dll,$(libdir)/System.dll,$(libdir)/System.Core.dll,$(libdir)/Steamworks.NET.dll,$(libdir)/Newtonsoft.Json.dll -out:"$(dllname)" -sdk:4 -recurse:'src/*.cs'
$(zipname): $(dllname) $(zip_files_extra)
$(RM) $(zipname)
mkdir -p $(builddir)
cp -r $(dllname) $(zip_files_extra) $(builddir)/
zip -r $(zipname) $(builddir)
$(RM) -r $(builddir)
.PHONY: build default clean all zip install serverlog clientlog
build: $(dllname)
zip: $(zipname)
default: build
all: checkjson build zip
clean:
$(RM) $(dllname) $(zipname)
$(RM) -r $(builddir)
install: build zip
$(RM) -r $(gamedir)/gamedata/mods/$(builddir)
unzip $(zipname) -d $(gamedir)/gamedata/mods
checkjson:
find . -type f -name "*.json" | while read f; do echo $$f; json_pp <$$f >/dev/null; done
serverlog:
less $(gamedir)/gamedata/logs/server/$$(ls -1rt $(gamedir)/gamedata/logs/server | tail -1)
clientlog:
less $(gamedir)/gamedata/logs/client/$$(ls -1rt $(gamedir)/gamedata/logs/client | tail -1)