clean out

add interface/InterfaceName target to create a template interface
move generate_newclass.sh to generate_new.sh and take class or interface as argument

Signed-off-by: philippe lhardy <philippe@pavilionartlogiciel>
This commit is contained in:
philippe lhardy
2015-02-19 22:21:44 +01:00
parent 7d8ce42c15
commit 0b33e56e0a
5 changed files with 53 additions and 9 deletions

View File

@@ -1,12 +1,13 @@
PACKAGE=org.artisanlogiciel.games
PACKAGE_DIR=$(subst .,/,$(PACKAGE))
OUT=out
EDITOR=emacs
$(OUT):
mkdir -p $(OUT)
clean:
find $(OUT) -name "*.class" -type f -print0|xargs -0 rm
@find $(OUT) -name "*.class" -type f -print0|xargs -0 rm 2>/dev/null || echo "nothing to clean"
test:
javac -d $(OUT) $(PACKAGE_DIR)/LabyModel.java
@@ -29,17 +30,21 @@ compile/%:
javac -d $(OUT) $(PACKAGE_DIR)/$(subst compile/,,$@).java
$(PACKAGE_DIR)/%.java:
./generate_newclass.sh $(subst .java,,$(subst $(PACKAGE_DIR)/,,$@))
./generate_new.sh class $(subst .java,,$(subst $(PACKAGE_DIR)/,,$@))
interface/%:
./generate_new.sh interface package_dir=$(PACKAGE_DIR) $(subst interface/,,$@)
$(EDITOR) $(PACKAGE_DIR)/$(subst interface/,,$@).java
work/%: $(PACKAGE_DIR)/$(subst work/,,%).java
emacs $<
$(EDITOR) $<
work: work/LabyModel
save:
git citool
.PHONY: clean test work display work/% run/% save compile/%
.PHONY: clean test work display work/% run/% save compile/% interface/%
# tried to avoid intermediate file removal : does not work
# .SECONDARY: $(PACKAGE_DIR)/%.java