-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.74 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.74 KB
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
# Makefile for building PersistentThrust
#KSPDIR := ${HOME}/.local/share/Steam/steamapps/common/Kerbal Space Program
KSPDIR := ${HOME}/.steam/steam/steamapps/common/Kerbal Space Program
MANAGED := ${KSPDIR}/KSP_Data/Managed/
SRCFILES := src/Extensions.cs \
src/SolarSailPart.cs \
src/Utils.cs \
src/Propellant.cs \
src/PersistentEngine.cs
MCS := mcs
TAR := tar
ZIP := zip
all: build
info:
@echo "== PersistentThrust Build Information =="
@echo " gmcs: ${MCS}"
@echo " tar: ${TAR}"
@echo " zip: ${ZIP}"
@echo " KSP Data: ${KSPDIR}"
@echo "==========================================="
build: build/PersistentThrust.dll
build/%.dll: ${SRCFILES}
mkdir -p build
${MCS} -t:library -lib:"${MANAGED}" \
-r:Assembly-CSharp,Assembly-CSharp-firstpass,UnityEngine,UnityEngine.UI \
-out:$@ \
${SRCFILES}
package: build ${SRCFILES}
mkdir -p package/PersistentThrust/Plugins
cp -r Parts package/PersistentThrust/
cp -r Patches package/PersistentThrust/
cp build/PersistentThrust.dll package/PersistentThrust/Plugins/
cp License.md README.org TODO.org CHANGELOG.org package/PersistentThrust/
%.tgz:
cd package; ${TAR} zcf ../$@ PersistentThrust
tgz: package SolarSailNavigator.tgz
%.zip:
cd package; ${ZIP} -9 -r ../$@ PersistentThrust
zip: package PersistentThrust.zip
clean:
@echo "Cleaning up build and package directories..."
rm -rf build/ package/
install: build
mkdir -p "${KSPDIR}"/GameData/PersistentThrust/Plugins
cp -r Parts "${KSPDIR}"/GameData/PersistentThrust/
cp -r Patches "${KSPDIR}"/GameData/PersistentThrust/
cp build/PersistentThrust.dll "${KSPDIR}"/GameData/PersistentThrust/Plugins/
uninstall: info
rm -rf "${KSPDIR}"/GameData/PersistentThrust/
.PHONY : all info build package tar.gz zip clean install uninstall