forked from MuMech/MechJeb2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (48 loc) · 1.74 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
# Makefile for building MechJeb
KSPDIR := ${HOME}/.local/share/Steam/SteamApps/common/Kerbal\ Space\ Program
MANAGED := KSP_Data/Managed/
MECHJEBFILES := $(wildcard MechJeb2/*.cs) \
$(wildcard MechJeb2/Properties/*.cs) \
$(wildcard MechJeb2/alglib/*.cs)
RESGEN2 := /usr/bin/resgen2
GMCS := /usr/bin/gmcs
GIT := /usr/bin/git
TAR := /usr/bin/tar
ZIP := /usr/bin/zip
all: build
info:
@echo "== MechJeb2 Build Information =="
@echo " resgen2: ${RESGEN2}"
@echo " gmcs: ${GMCS}"
@echo " git: ${GIT}"
@echo " tar: ${TAR}"
@echo " zip: ${ZIP}"
@echo " KSP Data: ${KSPDIR}"
@echo "================================"
build: info
mkdir -p build
${RESGEN2} -usesourcepath MechJeb2/Properties/Resources.resx build/Resources.resources
${GMCS} -t:library -lib:${KSPDIR}/${MANAGED} \
-r:Assembly-CSharp,Assembly-CSharp-firstpass,UnityEngine \
-out:build/MechJeb2.dll \
${MECHJEBFILES} \
-resource:build/Resources.resources,MuMech.Properties.Resources.resources
package: build
mkdir -p package/MechJeb2/Plugins
cp -r Parts package/MechJeb2/
cp build/MechJeb2.dll package/MechJeb2/Plugins/
tar.gz: package
${TAR} zcf MechJeb2-$(shell ${GIT} describe --tags --long --always).tar.gz package/MechJeb2
zip: package
${ZIP} -9 -r MechJeb2-$(shell ${GIT} describe --tags --long --always).zip package/MechJeb2
clean:
@echo "Cleaning up build and package directories..."
rm -rf build/ package/
install: build
mkdir -p ${KSPDIR}/GameData/MechJeb2/Plugins
cp -r Parts ${KSPDIR}/GameData/MechJeb2/
cp build/MechJeb2.dll ${KSPDIR}/GameData/MechJeb2/Plugins/
uninstall: info
rm -rf ${KSPDIR}/GameData/MechJeb2/Plugins
rm -rf ${KSPDIR}/GameData/MechJeb2/Parts
.PHONY : all info build package tar.gz zip clean install uninstall