Last active
April 7, 2018 19:29
-
-
Save greduan/07aea83e984096c38ecbf4b1d78f5440 to your computer and use it in GitHub Desktop.
Java Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_d=bin | |
lib_d=lib | |
source_d=src | |
JAVAC=javac | |
JFLAGS=-g -d $(class_d) -sourcepath $(source_d) -Xlint:all | |
s_app=$(shell find $(source_d) -name '*.java') | |
c_app=$(patsubst $(source_d)/%.java, $(class_d)/%.class, $(s_app)) | |
.PHONY: default all classes clean | |
default: classes | |
classes: $(c_app) $(class_d) | |
$(class_d)/%.class: $(source_d)/%.java | |
@echo "$@" | |
$(JAVAC) $(JFLAGS) $< | |
all: classes | |
clean: | |
rm -rf $(class_d)/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
java -classpath bin/ HelloWorld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment