PACKAGE = fr.monkhanny.dorfromantik
ENTRY = Main
SOURCEDIR = ./src/fr/monkhanny/dorfromantik/
BUILDDIR = ./build/
DOCDIR = ./doc/
JARNAME = dorfromantik.jar
CLASSP = ./libs/*:$(BUILDDIR)
MANIFESTPATH = Manifest.MF
SOURCEDIR = ./src/

SOURCES := $(shell find $(SOURCEDIR) -name '*.java')

all:
	@make clean
	@make compile
	@make jar
	@make run

compile:
	@echo "Compiling..."
	@javac -cp $(CLASSP) -d $(BUILDDIR) $(SOURCES) -Xlint:unchecked -Xlint:deprecation
	@echo "Done."

run:
	@echo "Running..."
	@java -cp $(CLASSP):$(JARNAME) fr.monkhanny.dorfromantik.Main
	@echo "Done."

clean:
	@echo "Cleaning up..."
	@rm -rf $(BUILDDIR)* $(DOCDIR)*
	@echo "Done."

javadoc:
	@echo "Generating javadoc..."
	@javadoc -d $(DOCDIR) -sourcepath src -subpackages $(PACKAGE)
	@echo "Done."

jar:
	@echo "Creating jar..."
	@jar cfm $(JARNAME) $(MANIFESTPATH) -C $(BUILDDIR) fr/monkhanny/dorfromantik ressources
	@echo "Done."
