2024-10-17 15:55:32 +02:00
|
|
|
RM = rm -rf
|
2024-10-17 16:21:21 +02:00
|
|
|
TAR = tar -czf
|
2024-10-17 15:55:32 +02:00
|
|
|
CP = cp -r
|
|
|
|
MKDIR = mkdir -p
|
2024-10-24 14:02:25 +02:00
|
|
|
PASTE = xclip -o
|
2024-10-17 15:55:32 +02:00
|
|
|
|
|
|
|
SRC_DIR = src
|
|
|
|
BIN_DIR = bin
|
|
|
|
|
2024-12-18 17:01:49 +01:00
|
|
|
JAVA_ARGS = --enable-preview -enableassertions
|
|
|
|
JAVAC_ARGS = -Xlint:unchecked
|
|
|
|
|
2024-10-24 14:02:25 +02:00
|
|
|
ENTRY := App
|
2024-12-18 17:01:49 +01:00
|
|
|
ARGV :=
|
2024-10-17 15:55:32 +02:00
|
|
|
|
|
|
|
ARCHIVE_NAME = nom
|
2024-10-17 16:21:21 +02:00
|
|
|
ARCHIVE_EXT = tar.gz
|
2024-12-18 17:01:49 +01:00
|
|
|
EXTRA_FILES :=
|
|
|
|
|
2024-10-17 15:55:32 +02:00
|
|
|
|
|
|
|
run: compilation
|
|
|
|
run:
|
2024-12-18 17:01:49 +01:00
|
|
|
java $(JAVA_ARGS) --class-path $(BIN_DIR) $(ENTRY) $(ARGV)
|
2024-10-17 15:55:32 +02:00
|
|
|
|
|
|
|
compilation:
|
2024-12-18 17:01:49 +01:00
|
|
|
find $(SRC_DIR) -name "*.java" -print | xargs javac $(JAVAC_ARGS) -d $(BIN_DIR)
|
2024-10-17 15:55:32 +02:00
|
|
|
|
2024-10-24 14:02:25 +02:00
|
|
|
paste:
|
|
|
|
mkdir -p $(SRC_DIR)
|
|
|
|
$(PASTE) > $(SRC_DIR)/Main.java
|
|
|
|
|
2024-10-17 15:55:32 +02:00
|
|
|
all:
|
|
|
|
run
|
|
|
|
|
|
|
|
clean:
|
2024-10-17 16:21:21 +02:00
|
|
|
$(RM) $(BIN_DIR) "$(ARCHIVE_NAME).$(ARCHIVE_EXT)"
|
2024-10-17 15:55:32 +02:00
|
|
|
|
|
|
|
archive:
|
|
|
|
$(MKDIR) "$(ARCHIVE_NAME)"
|
2024-12-18 17:01:49 +01:00
|
|
|
$(CP) $(EXTRA_FILES) "$(SRC_DIR)" "README.txt" "$(ARCHIVE_NAME)"
|
2024-10-17 16:21:21 +02:00
|
|
|
$(TAR) "$(ARCHIVE_NAME).$(ARCHIVE_EXT)" "$(ARCHIVE_NAME)"
|
2024-10-17 15:55:32 +02:00
|
|
|
$(RM) "$(ARCHIVE_NAME)"
|