makefile is hopefully working now and able to compile projects with .java and .jav files

This commit is contained in:
julian 2023-12-12 17:39:04 +01:00
parent f093edb74f
commit c9f125941d

View File

@ -1,4 +1,4 @@
JFLAGS = -g
JFLAGS = -g:none
JC = javac
JTX = JavaTXcompiler-0.1-jar-with-dependencies.jar
@ -23,17 +23,19 @@ all:
default: classes
# Rule for creating directories
$(DIRS):
@mkdir -p $@
#$(DIRS):
# @mkdir -p $@
# Rule for compiling jav files
$(DESTDIR)/%.class: $(SRCDIR)/%.jav | $(DIRS)
java -jar $(JTX) -d $(DESTDIR) -cp "src/main/java:target/dependencies/" $<
# Rule for compiling .jav files
$(DESTDIR)/%.class: $(SRCDIR)/%.jav #| $(DIRS)
@echo "$(dir $@)"
java -jar $(JTX) -d "$(dir $@)" -cp "src/main/java:target/dependencies/" $<
# Rule for compiling .java files
$(DESTDIR)/%.class: $(SRCDIR)/%.java #| $(DIRS)
$(JC) -nowarn -d "$(dir $@)" -cp "src/main/java:out:target/dependencies/*" $(JFLAGS) $<
#rule for compiling java files
$(DESTDIR)/%.class: $(SRCDIR)/%.java | $(DIRS)
$(JC) -nowarn -d $(DESTDIR) -cp "src/main/java:out:target/dependencies/*" $(JFLAGS) $<
classes: $(JAVCLASSES) $(JAVACLASSES)