Fix Makefile to include subfolders for javac

Also updated Input to fix string/double parsing
This commit is contained in:
Jesper Saastamoinen 2024-12-13 07:16:15 +01:00
parent 36281fa034
commit 98d5cf9c75
3 changed files with 12 additions and 4 deletions

1
.gitignore vendored
View file

@ -32,3 +32,4 @@ bin/
/src/*.jar /src/*.jar
/.idea /.idea
hello_world.froj hello_world.froj
testfile.froj

View file

@ -6,13 +6,15 @@ all: run
compile: compile:
rm -f $(FILE_PATH)/*.class rm -f $(FILE_PATH)/*.class
javac -d ./ $(FILE_PATH)/*.java javac -d ./ $(FILE_PATH)/*.java $(FILE_PATH)/**/*.java
jar -cfm $(FILE_NAME_JAR) ./META-INF/MANIFEST.MF $(FILE_PATH)/*.class jar -cfm $(FILE_NAME_JAR) ./META-INF/MANIFEST.MF $(FILE_PATH)/*.class $(FILE_PATH)/**/*.class
rm -f $(FILE_PATH)/*.class rm -f $(FILE_PATH)/*.class
rm -f $(FILE_PATH)/*/*.class
clean: clean:
rm -f $(FILE_PATH)/*.class rm -f $(FILE_PATH)/*.class
rm -f ./$(FILE_NAME_JAR) rm -f ./$(FILE_NAME_JAR)
rm -f $(FILE_PATH)/**/*.class
javac: javac:
javac -d ./ $(FILE_PATH)/*.java javac -d ./ $(FILE_PATH)/*.java

View file

@ -23,7 +23,12 @@ public class Input implements FrojCallable {
System.out.print("> "); System.out.print("> ");
try { try {
String line = reader.readLine(); String line = reader.readLine();
try {
return Double.parseDouble(line);
} catch(NumberFormatException ex) {
return line; return line;
}
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }