Mercurial > hg > ristipolku
annotate Makefile @ 205:76972d900783 default tip
Fix verbose build echos.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 29 Feb 2024 21:49:56 +0200 |
parents | dd2caf5321ba |
children |
rev | line source |
---|---|
193 | 1 ### |
2 ### Settings, directories | |
3 ### | |
4 # Utils | |
5 JAVA = java | |
6 JAVA_FLAGS += | |
7 JAVAC = javac | |
8 JAVAC_FLAGS += -g -Xlint:unchecked | |
9 JAVAC_FLAGS += -Xlint:deprecation | |
10 | |
11 | |
12 MAINCLASS=Ristipolku.class | |
165 | 13 JARFILE=Ristipolku.jar |
13 | 14 |
193 | 15 SRC=game/ |
16 | |
165 | 17 RESOURCES=\ |
18 graphics/*.png \ | |
19 graphics/*.jpg \ | |
20 graphics/font.ttf \ | |
21 sounds/*.wav | |
13 | 22 |
193 | 23 |
204 | 24 ### |
25 ### Functions and compilation/link commands | |
26 ### | |
193 | 27 ifneq ($(V),1) |
204 | 28 DO_CMD=/bin/echo -E " $(1) $(2)" && $(3) |
193 | 29 else |
205 | 30 DO_CMD=/bin/echo -E "$(3)" && $(3) |
193 | 31 endif |
204 | 32 DO_MKDIR=if test ! -z "$(1)" -a ! -d "$(1)"; then /bin/echo -E " MKDIR $(1)"; mkdir -p "$(1)"; fi |
33 | |
34 | |
35 COMPILE_JAVA_OBJ = \ | |
36 @$(call DO_MKDIR,$(OBJPATH)) ; \ | |
37 $(call DO_CMD,JAVAC,$<,$(JAVAC) $(JAVAC_FLAGS) $< $(1)) | |
193 | 38 |
39 | |
40 ### | |
41 ### Targets and generic rules | |
42 ### | |
204 | 43 TARGETS = $(MAINCLASS) |
193 | 44 |
45 all: $(TARGETS) | |
46 | |
47 | |
48 $(SRC)%.class: $(SRC)%.java | |
204 | 49 $(call COMPILE_JAVA_OBJ,) |
193 | 50 |
51 | |
52 ### | |
53 ### Class depencies | |
54 ### | |
55 $(SRC)IDMWidget.class: $(SRC)IDMPoint.class | |
56 | |
57 $(SRC)IDMButton.class: $(SRC)IDMWidget.class | |
58 | |
59 $(SRC)IDMContainer.class: $(SRC)IDMWidget.class | |
60 | |
61 $(SRC)IDMWindow.class: $(SRC)IDMWidget.class | |
62 | |
63 $(SRC)Engine.class: $(addprefix $(SRC),\ | |
165 | 64 Piece.class PieceType.class \ |
193 | 65 Interpolate.class \ |
165 | 66 ResourceLoader.class \ |
67 Sound.class SoundManager.class \ | |
68 IDMPoint.class IDMWidget.class \ | |
69 IDMButton.class IDMContainer.class \ | |
182
88b364dfd501
Rememeber to add the new class to build system ..
Matti Hamalainen <ccr@tnsp.org>
parents:
165
diff
changeset
|
70 IDMWindow.class \ |
193 | 71 AnimatedPointElement.class) |
165 | 72 |
193 | 73 Ristipolku.class: Ristipolku.java $(addprefix $(SRC),\ |
74 Engine.class) | |
204 | 75 $(call COMPILE_JAVA_OBJ,) |
9 | 76 |
1 | 77 |
197
f3302a2d7815
Convert to a Java application, instead of browser applet,
Matti Hamalainen <ccr@tnsp.org>
parents:
193
diff
changeset
|
78 run: $(MAINCLASS) |
f3302a2d7815
Convert to a Java application, instead of browser applet,
Matti Hamalainen <ccr@tnsp.org>
parents:
193
diff
changeset
|
79 @$(JAVA) $(JAVA_FLAGS) $(patsubst %.class,%,$<) |
1 | 80 |
81 | |
12 | 82 ### |
83 ### Package | |
84 ### | |
193 | 85 $(JARFILE): $(MAINCLASS) $(RESOURCES) |
86 jar cvfm $@ manifest.txt $(MAINCLASS) $(RESOURCES) $(SRC)*.class | |
13 | 87 |
12 | 88 |
89 ### | |
90 ### Cleanup | |
91 ### | |
1 | 92 clean: |
204 | 93 -$(RM) $(TARGETS) *.class $(SRC)*.class |
1 | 94 |
95 | |
200 | 96 distclean: clean |
204 | 97 -$(RM) *~ game/*~ graphics/*~ |
12 | 98 |
1 | 99 # dummy |