Last active
August 29, 2015 14:13
-
-
Save Dnomyar/d01d886731ccc88d3c63 to your computer and use it in GitHub Desktop.
Makefile JAVA
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
SRC = src | |
SOURCES = $(shell find ./src/ -name *.java) | |
S = java | |
SC = javac | |
TARGET = bin | |
CP = bin | |
VPATH=bin | |
run: compile | |
@echo ":: Executing..." | |
@$(S) -cp $(CP) App | |
compile: $(SOURCES:.%.java=.%.class) | |
%.class: %.java | |
clear | |
@echo ":: Compiling..." | |
@echo "Compiling $*.java.." | |
@# Little bit ugly but it's works. If you have another solution, don't hesitate to contact me. | |
@if [ $(shell stat -c %Y $*.java) -lt $(shell stat -c %Y $(shell echo "$*.class" | sed 's/src/bin/g')) ]; then echo ; else $(SC) -sourcepath $(SRC) -cp $(CP) -d $(TARGET) -encoding utf-8 $*.java; fi | |
clean: | |
@rm -R bin/* | |
# Pour supprimer les fichier .fuse* créés par sublime text | |
fuse: | |
@rm `find -name "*fuse*"` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment