makefiles/java_zip.mk

37 lines
619 B
Makefile
Raw Permalink Normal View History

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-10-24 14:02:25 +02:00
ENTRY := App
2024-10-17 15:55:32 +02:00
ARCHIVE_NAME = nom
2024-10-17 16:21:21 +02:00
ARCHIVE_EXT = tar.gz
2024-10-17 15:55:32 +02:00
run: compilation
run:
java --enable-preview -cp $(BIN_DIR) $(ENTRY)
compilation:
2024-10-17 16:26:28 +02:00
find $(SRC_DIR) -name "*.java" -print | xargs javac -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)"
$(CP) "$(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)"