added setup.sh, improved Makefile
This commit is contained in:
parent
b05a162d32
commit
36fb80a714
7
Makefile
7
Makefile
|
@ -6,6 +6,7 @@ INCDIR = $(BUILDDIR)inc/
|
||||||
INSTALLDIR = /usr/lib/
|
INSTALLDIR = /usr/lib/
|
||||||
LDFLAGS = -I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/ -I$(INCDIR) -Isrc/main/cpp/inc/ #-ldl
|
LDFLAGS = -I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/ -I$(INCDIR) -Isrc/main/cpp/inc/ #-ldl
|
||||||
NAME = libplugin.so
|
NAME = libplugin.so
|
||||||
|
SERVER = testerver/
|
||||||
|
|
||||||
SRCFILES = $(wildcard $(SRCDIR)*.cpp)
|
SRCFILES = $(wildcard $(SRCDIR)*.cpp)
|
||||||
OBJFILES = $(patsubst $(SRCDIR)%, $(BUILDDIR)%, $(patsubst %.cpp,%.so,$(SRCFILES)))
|
OBJFILES = $(patsubst $(SRCDIR)%, $(BUILDDIR)%, $(patsubst %.cpp,%.so,$(SRCFILES)))
|
||||||
|
@ -31,13 +32,13 @@ $(BUILDDIR)%: $(SRCDIR)%.cpp $(BUILDDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(BUILDDIR)
|
$(RM) -r $(BUILDDIR)
|
||||||
$(RM) testserver/plugins/*.so testserver/plugins/CppPlugins/*.so testplugins/*/*.so
|
$(RM) $(SERVER)plugins/*.so $(SERVER)plugins/CppPlugins/*.so testplugins/*/*.so
|
||||||
|
|
||||||
$(BUILDDIR):
|
$(BUILDDIR):
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
createhfiles:
|
createhfiles:
|
||||||
$(RM) -r $(INCDIR)
|
$(RM) -r $(INCDIR)
|
||||||
javah -d $(INCDIR) -classpath target/classes/:$(HOME)/.m2/repository/org/bukkit/craftbukkit/1.7.10-R0.1-SNAPSHOT/craftbukkit-1.7.10-R0.1-SNAPSHOT.jar de.mrbesen.cppplugins.CppPlugin
|
javah -d $(INCDIR) -classpath $(BUILDDIR)classes/:$(HOME)/.m2/repository/org/bukkit/craftbukkit/1.7.10-R0.1-SNAPSHOT/craftbukkit-1.7.10-R0.1-SNAPSHOT.jar de.mrbesen.cppplugins.CppPlugin
|
||||||
|
|
||||||
.PHONY: createhfiles clean plugins
|
.PHONY: createhfiles clean plugins
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#This script basicly just downloads spigot
|
||||||
|
|
||||||
|
server="testserver/"
|
||||||
|
buildtools="${server}buildtools/"
|
||||||
|
mcvers="1.12.2"
|
||||||
|
|
||||||
|
mkdir -p "$server" "${buildtools}"
|
||||||
|
oldpwd=$(dirname $(realpath $0))
|
||||||
|
cd "$buildtools"
|
||||||
|
wget -nc https://hub.spigotmc.org/jenkins/job/BuildTools/lastStableBuild/artifact/target/BuildTools.jar
|
||||||
|
java -jar BuildTools.jar --compile SPIGOT --rev "$mcvers"
|
||||||
|
|
||||||
|
cd "${oldpwd}"
|
||||||
|
|
||||||
|
cp "${buildtools}spigot-${mcvers}.jar" "${server}"
|
||||||
|
echo "eula=true" > "${server}eula.txt"
|
||||||
|
|
||||||
|
printf "\n\n\n\n"
|
||||||
|
echo "server installed into: ${server}"
|
||||||
|
|
||||||
|
echo "delete ${buildtools} ?"
|
||||||
|
rm -frI "${buildtools}"
|
Loading…
Reference in New Issue