-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
84 lines (68 loc) · 2.28 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
######################################################################
#
# Kerbal SimPit Makefile
#
######################################################################
# Configurable paths
# KSPDIR
# This should be the path to a valid Kerbal Space Program installation.
# Defining KSPDIR in the environment will override this.
ifndef KSPDIR
KSPDIR=KerbalSpaceProgram
endif
# KSPLIBDIR
# Path to the KSP managed libraries. Again, setting KSPLIBDIR in
# the environment will overwrite this.
ifndef KSPLIBDIR
# This default works for macOS
#KSPLIBDIR=$(KSPDIR)/KSP.app/Contents/Resources/Data/Managed
# On Linux, comment out the above line and try this
KSPLIBDIR=$(KSPDIR)/KSP_x64_Data/Managed
endif
# Things less likely to need configuring:
# INSTALLDIR
# Where to install the plugin
INSTALLDIR= install/KerbalSimpit/
# CONFIGDIR
# Where the plugin's configuration files are stored
CONFIGDIR=$(KSPDIR)/GameData/KerbalSimpit/
# Shouldn't need to change variables below here
MSBUILD=msbuild
CONFIG=Release
PACKAGEDIR=package/KerbalSimpit
ifdef PLUGINVERSION
BUILDVERSION=$(PLUGINVERSION)
ZIPNAME=KerbalSimpit-$(PLUGINVERSION).zip
else
BUILDVERSION=0
ZIPNAME=KerbalSimpit.zip
endif
export KSPDIR
export KSPLIBDIR
all:KerbalSimpit.dll
KerbalSimpit.dll:Properties/AssemblyInfo.cs
$(MSBUILD) /p:Configuration=$(CONFIG) Main.csproj
install:all
mkdir -p $(INSTALLDIR)
cp Bin/KerbalSimpit.dll $(INSTALLDIR)
mkdir -p $(INSTALLDIR)/Localisations
cp KerbalSimpit/Localisation/*.cfg $(INSTALLDIR)/Localisations
clean:
$(MSBUILD) /p:Configuration=$(CONFIG) /t:Clean Main.csproj
rm -f KerbalSimpit.version
rm -f Properties/AssemblyInfo.cs
rm -f Properties/SerialAssemblyInfo.cs
rm -f *.zip
KerbalSimpit.version:KerbalSimpit.version.m4 version-info.m4
m4 -DBUILDVER=$(BUILDVERSION) version-info.m4 KerbalSimpit.version.m4 > KerbalSimpit.version
validate:KerbalSimpit.version
jq '.' KerbalSimpit.version > /dev/null
Properties/AssemblyInfo.cs:Properties/AssemblyInfo.cs.m4 version-info.m4
m4 -DBUILDVER=$(BUILDVERSION) version-info.m4 Properties/AssemblyInfo.cs.m4 > Properties/AssemblyInfo.cs
package: all KerbalSimpit.version
mkdir -p $(PACKAGEDIR)
cp Bin/*.dll $(PACKAGEDIR)
cp KerbalSimpit.version $(PACKAGEDIR)
cp -r distrib/* $(PACKAGEDIR)
cd package; zip -r -9 ../$(ZIPNAME) KerbalSimpit
rm -r package