Skip to content

Instantly share code, notes, and snippets.

@felipedavi
Created July 31, 2021 16:00
Show Gist options
  • Save felipedavi/89660bb4a7c8c262342b22474f9ed659 to your computer and use it in GitHub Desktop.
Save felipedavi/89660bb4a7c8c262342b22474f9ed659 to your computer and use it in GitHub Desktop.
Java Makefile
# vim: noet ft=make:
JAVAC = javac
JAVA = java
SRC := $(wildcard *.java)
TARGET := $(SRC:%.java=%.class)
BIN := $(TARGET:%.class=%)
all: run
%.class: %.java
@$(JAVAC) $^
run: $(TARGET)
@$(JAVA) $(BIN)
clean:
@echo "Cleaning up..."
@rm -f $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment