2024-03-12 19:05:26 +00:00
|
|
|
JFLAGS = -g:none -implicit:none
|
2023-11-23 15:20:44 +00:00
|
|
|
JC = javac
|
|
|
|
|
2024-03-13 18:27:01 +00:00
|
|
|
JTX = JavaTXcompiler-1.0-jar-with-dependencies.jar
|
2023-11-23 16:08:47 +00:00
|
|
|
|
2024-02-02 12:06:37 +00:00
|
|
|
SRCDIR = javatx-src/main/java
|
2023-11-23 15:20:44 +00:00
|
|
|
DESTDIR = out
|
|
|
|
|
2024-04-21 23:06:03 +00:00
|
|
|
# Use find to locate all .java and .jav files recursively
|
2023-11-23 16:08:47 +00:00
|
|
|
JAVASOURCES := $(shell find $(SRCDIR) -name '*.java')
|
|
|
|
JAVSOURCES := $(shell find $(SRCDIR) -name '*.jav')
|
2023-11-23 15:20:44 +00:00
|
|
|
|
|
|
|
# Convert .java files to .class files with the same directory structure
|
2023-11-23 16:08:47 +00:00
|
|
|
JAVACLASSES := $(patsubst $(SRCDIR)/%.java,$(DESTDIR)/%.class,$(JAVASOURCES))
|
|
|
|
JAVCLASSES := $(patsubst $(SRCDIR)/%.jav,$(DESTDIR)/%.class,$(JAVSOURCES))
|
2023-11-23 15:20:44 +00:00
|
|
|
|
|
|
|
default: classes
|
|
|
|
|
2024-02-06 08:48:24 +00:00
|
|
|
$(DESTDIR):
|
|
|
|
mkdir -p $(DESTDIR)
|
2023-11-23 15:20:44 +00:00
|
|
|
|
2024-02-06 08:48:24 +00:00
|
|
|
# Rule for creating directories
|
2023-11-23 16:08:47 +00:00
|
|
|
|
2023-12-12 16:39:04 +00:00
|
|
|
# Rule for compiling .jav files
|
2024-02-06 08:48:24 +00:00
|
|
|
$(DESTDIR)/%.class: $(SRCDIR)/%.jav | $(DESTDIR)
|
2024-03-12 19:05:26 +00:00
|
|
|
java -jar $(JTX) -d "$(dir $@)" -cp "$(SRCDIR):$(DESTDIR):target/dependencies/" $<
|
2023-12-12 16:39:04 +00:00
|
|
|
|
|
|
|
# Rule for compiling .java files
|
2024-02-06 08:48:24 +00:00
|
|
|
$(DESTDIR)/%.class: $(SRCDIR)/%.java | $(DESTDIR)
|
2024-03-12 19:05:26 +00:00
|
|
|
$(JC) -nowarn -d $(DESTDIR) -cp "$(SRCDIR):$(DESTDIR):target/dependencies/*" $(JFLAGS) $<
|
2023-11-23 16:08:47 +00:00
|
|
|
|
2023-11-23 15:20:44 +00:00
|
|
|
|
2023-11-23 16:08:47 +00:00
|
|
|
classes: $(JAVCLASSES) $(JAVACLASSES)
|
2023-11-23 15:20:44 +00:00
|
|
|
|
|
|
|
clean:
|
2024-02-02 12:06:37 +00:00
|
|
|
$(RM) -r $(DESTDIR)/*
|