Java内容重新整理删除过期的东西

This commit is contained in:
estom
2025-09-14 03:49:42 -04:00
parent 9b8524ff80
commit 885b795e45
413 changed files with 643 additions and 1340 deletions

View File

@@ -0,0 +1,54 @@
# Makefile for multiclass-demo Java project
# Java compiler and options
JAVAC = javac
JAVA = java
JFLAGS = -g
# Source and build directories
SRC_DIR = src
BUILD_DIR = build
# Find all Java source files
SOURCES = $(shell find $(SRC_DIR) -name "*.java")
CLASSES = $(SOURCES:$(SRC_DIR)/%.java=$(BUILD_DIR)/%.class)
# Main class
MAIN_CLASS = com.example.Application
# Default target
.PHONY: all
all: compile
# Compile all Java source files
.PHONY: compile
compile:
@mkdir -p $(BUILD_DIR)
$(JAVAC) $(JFLAGS) -sourcepath $(SRC_DIR) -d $(BUILD_DIR) $(SOURCES)
@echo "Compilation completed successfully!"
# Run the application
.PHONY: run
run: compile
$(JAVA) -cp $(BUILD_DIR) $(MAIN_CLASS)
# Clean compiled classes
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)/*
@echo "Clean completed!"
# Rebuild the project
.PHONY: rebuild
rebuild: clean compile
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " all - Compile all source files (default)"
@echo " compile - Compile all source files"
@echo " run - Compile and run the application"
@echo " clean - Remove all compiled classes"
@echo " rebuild - Clean and compile all source files"
@echo " help - Display this help message"