makefiles/java_zip.mk
2024-10-24 14:02:25 +02:00

36 lines
619 B
Makefile

RM = rm -rf
TAR = tar -czf
CP = cp -r
MKDIR = mkdir -p
PASTE = xclip -o
SRC_DIR = src
BIN_DIR = bin
ENTRY := App
ARCHIVE_NAME = nom
ARCHIVE_EXT = tar.gz
run: compilation
run:
java --enable-preview -cp $(BIN_DIR) $(ENTRY)
compilation:
find $(SRC_DIR) -name "*.java" -print | xargs javac -d $(BIN_DIR)
paste:
mkdir -p $(SRC_DIR)
$(PASTE) > $(SRC_DIR)/Main.java
all:
run
clean:
$(RM) $(BIN_DIR) "$(ARCHIVE_NAME).$(ARCHIVE_EXT)"
archive:
$(MKDIR) "$(ARCHIVE_NAME)"
$(CP) "$(SRC_DIR)" README.txt "$(ARCHIVE_NAME)"
$(TAR) "$(ARCHIVE_NAME).$(ARCHIVE_EXT)" "$(ARCHIVE_NAME)"
$(RM) "$(ARCHIVE_NAME)"