From f6d2c9a4a27847aafca59d9ae3be1b71b6fdb453 Mon Sep 17 00:00:00 2001 From: u55 Date: Sat, 16 Apr 2016 18:55:40 -0600 Subject: [PATCH] Add a makefile. --- Documentation/Compiling.txt | 4 ++++ Makefile | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Makefile diff --git a/Documentation/Compiling.txt b/Documentation/Compiling.txt index 4e3c3fe..083dc31 100755 --- a/Documentation/Compiling.txt +++ b/Documentation/Compiling.txt @@ -2,6 +2,10 @@ ====COMPILING.TXT==== +On Linux, run the Makefile: + make +or otherwise execute the following individual steps: + 1. Get your compiler version: javac -version and enter the version on line 19 of B4constants.java where it will become available diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..caa899d --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Name of the jarfile. +JARNAME=BEAM4.jar + +# Java version number. +JAVAVER=$(shell javac -version 2>&1) +STR="s/\(^ static final String COMPILER = \"Compiler was: \).*\(\";.*$$\)/\1${JAVAVER}\2/g" + +all: + @# Replace Java version number string in source code. + sed -i ${STR} Sources/B4constants.java + + @# Compile java files. + javac -Xlint Sources/*.java + + @# Create jar archive. + install -d com/stellarsoftware/beam/ + install -D Sources/*.class com/stellarsoftware/beam/ + jar cfe "${JARNAME}" com.stellarsoftware.beam.B4 com/ + +clean: + rm -rf Sources/*.class com/