|
3 | 3 | # file lists |
4 | 4 | # |
5 | 5 |
|
6 | | -PCX_TOOLS=\ |
| 6 | +TARGETS=\ |
7 | 7 | $(PCX2MSX) \ |
8 | 8 | $(PCX2SPR) \ |
9 | 9 | $(PCX2MSXPLUS) \ |
10 | | - $(PCX2SPRPLUS) |
11 | | - |
12 | | -PNG_TOOLS=\ |
| 10 | + $(PCX2SPRPLUS) \ |
13 | 11 | $(PNG2MSX) \ |
14 | 12 | $(PNG2SPR) \ |
15 | | - $(PNG2SPRPLUS) |
16 | | - |
17 | | -TMX_TOOLS= \ |
| 13 | + $(PNG2SPRPLUS) \ |
18 | 14 | $(TMX2BIN) |
19 | 15 |
|
20 | | -PCX_TESTS=\ |
21 | | - test/charset.pcx.chr \ |
22 | | - test/charset.pcx.clr \ |
23 | | - test/bigsprites.pcx.spat.asm \ |
24 | | - test/bigsprites.pcx.spr.asm |
| 16 | +OBJS_PCX=\ |
| 17 | + src/args.o \ |
| 18 | + src/bitmap.o \ |
| 19 | + src/readpcx.o |
25 | 20 |
|
26 | | -PNG_TESTS=\ |
27 | | - test/charset.png.chr \ |
28 | | - test/charset.png.clr \ |
29 | | - test/bigsprites.png.spat.asm \ |
30 | | - test/bigsprites.png.spr.asm |
| 21 | +OBJS_PNG=\ |
| 22 | + src/args.o \ |
| 23 | + src/bitmap.o \ |
| 24 | + src/readpng.o \ |
| 25 | + src/lodepng/lodepng.o |
31 | 26 |
|
32 | | -TMX_TESTS=\ |
33 | | - test/screen.tmx.bin \ |
34 | | - test/metatiles.tmx.bin |
| 27 | +OBJS_TMX=\ |
| 28 | + src/args.o \ |
| 29 | + src/tiled.o \ |
| 30 | + src/readtmx.o |
35 | 31 |
|
36 | | -COMMON_DEPS_C=\ |
37 | | - src/args.c |
38 | | - |
39 | | -COMMON_DEPS_PCX_C=\ |
40 | | - src/bitmap.c \ |
41 | | - src/readpcx.c \ |
42 | | - $(COMMON_DEPS_C) |
43 | | - |
44 | | -COMMON_DEPS_PNG_C=\ |
45 | | - src/bitmap.c \ |
46 | | - src/readpng.c \ |
47 | | - src/lodepng/lodepng.c \ |
48 | | - $(COMMON_DEPS_C) |
49 | | - |
50 | | -COMMON_DEPS_TMX_C=\ |
51 | | - src/tiled.c \ |
52 | | - src/readtmx.c \ |
53 | | - $(COMMON_DEPS_C) |
54 | | - |
55 | | -COMMON_DEPS_H=\ |
56 | | - src/args.h |
57 | | - |
58 | | -COMMON_DEPS_PCX_H=\ |
| 32 | +DEPS_PCX=\ |
| 33 | + src/args.h \ |
59 | 34 | src/bitmap.h \ |
60 | | - src/readpcx.h \ |
61 | | - $(COMMON_DEPS_H) |
| 35 | + src/readpcx.h |
62 | 36 |
|
63 | | -COMMON_DEPS_PNG_H=\ |
| 37 | +DEPS_PNG=\ |
| 38 | + src/args.h \ |
64 | 39 | src/bitmap.h \ |
65 | 40 | src/readpng.h \ |
66 | | - src/lodepng/lodepng.h \ |
67 | | - $(COMMON_DEPS_H) |
| 41 | + src/lodepng/lodepng.h |
68 | 42 |
|
69 | | -COMMON_DEPS_TMX_H=\ |
| 43 | +DEPS_TMX=\ |
| 44 | + src/args.h \ |
70 | 45 | src/tiled.h \ |
71 | | - src/readtmx.h \ |
72 | | - $(COMMON_DEPS_H) |
| 46 | + src/readtmx.h |
| 47 | + |
| 48 | +TESTS=\ |
| 49 | + test/charset.pcx.chr \ |
| 50 | + test/charset.pcx.clr \ |
| 51 | + test/bigsprites.pcx.spat.asm \ |
| 52 | + test/bigsprites.pcx.spr.asm \ |
| 53 | + test/charset.png.chr \ |
| 54 | + test/charset.png.clr \ |
| 55 | + test/bigsprites.png.spat.asm \ |
| 56 | + test/bigsprites.png.spr.asm \ |
| 57 | + test/screen.tmx.bin \ |
| 58 | + test/metatiles.tmx.bin |
73 | 59 |
|
74 | 60 | # |
75 | 61 | # default target |
76 | 62 | # |
77 | 63 |
|
78 | | -default: compile_png |
79 | | - |
80 | | -clean: clean_pcx clean_png clean_tmx |
81 | | - |
82 | | -clean_pcx: |
83 | | - $(REMOVE) $(PCX_TOOLS) |
84 | | - |
85 | | -clean_png: |
86 | | - $(REMOVE) $(PNG_TOOLS) |
87 | | - |
88 | | -clean_tmx: |
89 | | - $(REMOVE) $(TMX_TOOLS) |
| 64 | +default: all |
90 | 65 |
|
91 | | -compile: $(PCX_TOOLS) $(PNG_TOOLS) $(TMX_TOOLS) |
| 66 | +clean: |
| 67 | + $(REMOVE) $(TARGETS) |
92 | 68 |
|
93 | | -compile_pcx: $(PCX_TOOLS) |
| 69 | +all: $(TARGETS) |
94 | 70 |
|
95 | | -compile_png: $(PNG_TOOLS) |
96 | | - |
97 | | -compile_tmx: $(TMX_TOOLS) |
98 | | - |
99 | | -test: test_pcx test_png test_tmx |
100 | | - |
101 | | -test_pcx: $(PCX_TOOLS) $(PCX_TESTS) |
102 | | - |
103 | | -test_png: $(PNG_TOOLS) $(PNG_TOOLS) |
104 | | - |
105 | | -test_tmx: $(TMX_TOOLS) $(TMX_TOOLS) |
| 71 | +test: $(TOOLS) $(TESTS) |
106 | 72 |
|
107 | 73 | demo: demo_sprplus_pcx demo_sprplus_png |
108 | 74 |
|
| 75 | +.PHONY: default clean all test demo |
| 76 | + |
109 | 77 | # |
110 | 78 | # main targets |
111 | 79 | # |
112 | 80 |
|
113 | | -$(PCX2MSX): \ |
114 | | -src/pcx2msx.c \ |
115 | | -$(COMMON_DEPS_PCX_C) src/charset.c \ |
116 | | -$(COMMON_DEPS_PCX_H) src/charset.h |
117 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PCX_C) src/charset.c -o $@ |
118 | | - |
119 | | -$(PCX2MSXPLUS): \ |
120 | | -src/pcx2msx+.c \ |
121 | | -$(COMMON_DEPS_PCX_C) src/charset.c src/nametable.c \ |
122 | | -$(COMMON_DEPS_PCX_H) src/charset.h src/nametable.h |
123 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PCX_C) src/charset.c src/nametable.c -o $@ |
124 | | - |
125 | | -$(PCX2SPR): \ |
126 | | -src/pcx2spr.c \ |
127 | | -$(COMMON_DEPS_PCX_C) src/sprite.c \ |
128 | | -$(COMMON_DEPS_PCX_H) src/sprite.h |
129 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PCX_C) src/sprite.c -o $@ |
130 | | - |
131 | | -$(PCX2SPRPLUS): \ |
132 | | -src/pcx2spr+.c \ |
133 | | -$(COMMON_DEPS_PCX_C) src/sprite+.c src/output.c \ |
134 | | -$(COMMON_DEPS_PCX_H) src/sprite.h src/sprite+.h src/output.h |
135 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PCX_C) src/sprite+.c src/output.c -o $@ |
| 81 | +$(PCX2MSX): src/pcx2msx.c $(OBJS_PCX) src/charset.o $(DEPS_PCX) src/charset.h |
| 82 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/charset.o |
| 83 | + |
| 84 | +$(PCX2MSXPLUS): src/pcx2msx+.c $(OBJS_PCX) src/charset.c src/nametable.c $(DEPS_PCX) src/charset.h src/nametable.h |
| 85 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/charset.c src/nametable.c |
| 86 | + |
| 87 | +$(PCX2SPR): src/pcx2spr.c $(OBJS_PCX) src/sprite.c $(DEPS_PCX) src/sprite.h |
| 88 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/sprite.c |
| 89 | + |
| 90 | +$(PCX2SPRPLUS): src/pcx2spr+.c $(OBJS_PCX) src/sprite+.c src/output.c $(DEPS_PCX) src/sprite.h src/sprite+.h src/output.h |
| 91 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/sprite+.c src/output.c |
136 | 92 |
|
137 | 93 | # |
138 | 94 |
|
139 | | -$(PNG2MSX): \ |
140 | | -src/png2msx.c \ |
141 | | -$(COMMON_DEPS_PNG_C) src/charset.c src/nametable.c \ |
142 | | -$(COMMON_DEPS_PNG_H) src/charset.h src/nametable.h |
143 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PNG_C) src/charset.c src/nametable.c -o $@ $(CCOMPILER_LINKER_OPTIONS) |
| 95 | +$(PNG2MSX): src/png2msx.c $(OBJS_PNG) src/charset.o src/nametable.o $(DEPS_PNG) src/charset.h src/nametable.h |
| 96 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/charset.o src/nametable.o $(LDFLAGS) |
144 | 97 |
|
145 | | -$(PNG2SPR): \ |
146 | | -src/png2spr.c \ |
147 | | -$(COMMON_DEPS_PNG_C) src/sprite.c \ |
148 | | -$(COMMON_DEPS_PNG_H) src/sprite.h |
149 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PNG_C) src/sprite.c -o $@ $(CCOMPILER_LINKER_OPTIONS) |
| 98 | +$(PNG2SPR): src/png2spr.c $(OBJS_PNG) src/sprite.o $(DEPS_PNG) src/sprite.h |
| 99 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/sprite.o $(LDFLAGS) |
150 | 100 |
|
151 | | -$(PNG2SPRPLUS): \ |
152 | | -src/png2spr+.c \ |
153 | | -$(COMMON_DEPS_PNG_C) src/sprite+.c src/output.c \ |
154 | | -$(COMMON_DEPS_PNG_H) src/sprite.h src/sprite+.h src/output.h |
155 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_PNG_C) src/sprite+.c src/output.c -o $@ $(CCOMPILER_LINKER_OPTIONS) |
| 101 | +$(PNG2SPRPLUS): src/png2spr+.c $(OBJS_PNG) src/sprite+.o src/output.o $(DEPS_PNG) src/sprite.h src/sprite+.h src/output.h |
| 102 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/sprite+.o src/output.o $(LDFLAGS) |
156 | 103 |
|
157 | 104 | # |
158 | 105 |
|
159 | | -$(TMX2BIN): \ |
160 | | -src/tmx2bin.c \ |
161 | | -$(COMMON_DEPS_TMX_C) \ |
162 | | -$(COMMON_DEPS_TMX_H) |
163 | | - $(CCOMPILER) $(CCOMPILER_OPTIONS) $< $(COMMON_DEPS_TMX_C) -o $@ |
| 106 | +$(TMX2BIN): src/tmx2bin.c $(OBJS_TMX) $(DEPS_TMX) |
| 107 | + $(CC) $(CFLAGS) -o $@ $< $(OBJS_TMX) |
164 | 108 |
|
165 | 109 | # |
166 | 110 | # test targets |
|
0 commit comments