view Makefile @ 182:88b364dfd501

Rememeber to add the new class to build system ..
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 16 Mar 2017 12:23:17 +0200
parents 0303db4df28f
children 189cd8fe2304
line wrap: on
line source

# Settings, directories
RUN=Ristipolku.class
JARFILE=Ristipolku.jar

SRC=game
RESOURCES=\
	graphics/*.png \
	graphics/*.jpg \
	graphics/font.ttf \
	sounds/*.wav

CLASSES=G.class \
	Piece.class PieceType.class \
	Engine.class Interpolate.class \
	ResourceLoader.class \
	Sound.class SoundManager.class \
	IDMPoint.class IDMWidget.class \
	IDMButton.class IDMContainer.class \
	IDMWindow.class \
	AnimatedPointElement.class

# Utils
JAVAC=javac
JAVAC_FLAGS=-g -Xlint:unchecked
APPLETVIEWER=aoss appletviewer


###
### Targets
###
TARGETS=$(RUN)

all: $(TARGETS)

$(SRC)/%.class: $(SRC)/%.java
	$(JAVAC) $(JAVAC_FLAGS) $<

Ristipolku.class: Ristipolku.java $(addprefix $(SRC)/,$(CLASSES))
	$(JAVAC) $(JAVAC_FLAGS) $<


run: $(RUN)
	$(APPLETVIEWER) $(patsubst %.class,%.html,$<)


###
### Package
###
$(JARFILE): $(RUN) $(RESOURCES)
	jar cvfm $@ manifest.txt $+ $(SRC)/*.class


upload: $(JARFILE)
	@scp $+ ccr@tnsp.org:tnsp/ristipolku/
	$(RM) $<


###
### Cleanup
###
clean:
	$(RM) $(TARGETS) *.class $(SRC)/*.class


srcclean: clean
	$(RM) *~ game/*~ graphics/*~

# dummy