-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathshared.makefile
More file actions
129 lines (96 loc) · 2.94 KB
/
Copy pathshared.makefile
File metadata and controls
129 lines (96 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# (GNU Make prefers a POSIX shell whenever possible, so explicitly force it)
SHELL=sh
#
# file lists
#
TARGETS=\
$(PCX2MSX) \
$(PCX2SPR) \
$(PCX2MSXPLUS) \
$(PCX2SPRPLUS) \
$(PNG2MSX) \
$(PNG2SPR) \
$(PNG2SPRPLUS) \
$(TMX2BIN)
OBJS_PCX=\
src/args.o \
src/bitmap.o \
src/readpcx.o
OBJS_PNG=\
src/args.o \
src/bitmap.o \
src/readpng.o \
src/lodepng/lodepng.o
OBJS_TMX=\
src/args.o \
src/tiled.o \
src/readtmx.o
DEPS_PCX=\
src/args.h \
src/bitmap.h \
src/readpcx.h
DEPS_PNG=\
src/args.h \
src/bitmap.h \
src/readpng.h \
src/lodepng/lodepng.h
DEPS_TMX=\
src/args.h \
src/tiled.h \
src/readtmx.h
TESTS=\
test/charset.pcx.chr \
test/charset.pcx.clr \
test/bigsprites.pcx.spat.asm \
test/bigsprites.pcx.spr.asm \
test/charset.png.chr \
test/charset.png.clr \
test/bigsprites.png.spat.asm \
test/bigsprites.png.spr.asm \
test/screen.tmx.bin \
test/metatiles.tmx.bin
#
# default target
#
default: all
clean:
rm $(TARGETS)
all: $(TARGETS)
test: $(TOOLS) $(TESTS)
.PHONY: default clean all test
#
# main targets
#
$(PCX2MSX): src/pcx2msx.c $(OBJS_PCX) src/charset.o $(DEPS_PCX) src/charset.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/charset.o
$(PCX2MSXPLUS): src/pcx2msx+.c $(OBJS_PCX) src/charset.c src/nametable.c $(DEPS_PCX) src/charset.h src/nametable.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/charset.c src/nametable.c
$(PCX2SPR): src/pcx2spr.c $(OBJS_PCX) src/sprite.c $(DEPS_PCX) src/sprite.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/sprite.c
$(PCX2SPRPLUS): src/pcx2spr+.c $(OBJS_PCX) src/sprite+.c src/output.c $(DEPS_PCX) src/sprite.h src/sprite+.h src/output.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PCX) src/sprite+.c src/output.c
#
$(PNG2MSX): src/png2msx.c $(OBJS_PNG) src/charset.o src/nametable.o $(DEPS_PNG) src/charset.h src/nametable.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/charset.o src/nametable.o $(LDFLAGS)
$(PNG2SPR): src/png2spr.c $(OBJS_PNG) src/sprite.o $(DEPS_PNG) src/sprite.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/sprite.o $(LDFLAGS)
$(PNG2SPRPLUS): src/png2spr+.c $(OBJS_PNG) src/sprite+.o src/output.o $(DEPS_PNG) src/sprite.h src/sprite+.h src/output.h
$(CC) $(CFLAGS) -o $@ $< $(OBJS_PNG) src/sprite+.o src/output.o $(LDFLAGS)
#
$(TMX2BIN): src/tmx2bin.c $(OBJS_TMX) $(DEPS_TMX)
$(CC) $(CFLAGS) -o $@ $< $(OBJS_TMX)
#
# test targets
#
test/charset.pcx.chr test/charset.pcx.clr &: $(PCX2MSX) test/charset.pcx
$(PCX2MSX) -v test/charset.pcx
test/charset.png.chr test/charset.png.clr &: $(PNG2MSX) test/charset.png
$(PNG2MSX) -v test/charset.png
test/bigsprites.pcx.spat.asm test/bigsprites.pcx.spr.asm &: $(PCX2SPRPLUS) test/bigsprites.pcx
$(PCX2SPRPLUS) -v -vv -w24 -h32 test/bigsprites.pcx
test/bigsprites.png.spat.asm test/bigsprites.png.spr.asm &: $(PNG2SPRPLUS) test/bigsprites.png
$(PNG2SPRPLUS) -v -vv -w24 -h32 test/bigsprites.png
test/screen.tmx.bin: $(TMX2BIN) test/screen.tmx
$(TMX2BIN) -v test/screen.tmx
test/metatiles.tmx.bin: $(TMX2BIN) test/metatiles.tmx
$(TMX2BIN) -v -t2 test/metatiles.tmx