-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
executable file
·98 lines (73 loc) · 2.62 KB
/
Makefile
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
.SUFFIXES: .bin .prg
.PRECIOUS: %.ngd %.ncd %.twx
COPT= -Wall -g -std=c99
CC= gcc
OPHIS= ../Ophis/bin/ophis -4
CA65= ca65 --cpu 4510
LD65= ld65 -t none
ASSETS= assets
SRCDIR= src
BINDIR= bin
DIALER_ASSETS= \
$(ASSETS)/dial0.png \
$(ASSETS)/dial1.png \
$(ASSETS)/dial2.png \
$(ASSETS)/dial3.png \
$(ASSETS)/dial4.png \
$(ASSETS)/dial5.png \
$(ASSETS)/dial6.png \
$(ASSETS)/dial7.png \
$(ASSETS)/dial8.png \
$(ASSETS)/dial9.png \
$(ASSETS)/dialhash.png \
$(ASSETS)/dialstar.png \
VEHICLE_ASSETS= \
$(ASSETS)/vehicle_console_cluster.svg.png \
$(ASSETS)/0.png \
$(ASSETS)/1.png \
$(ASSETS)/2.png \
$(ASSETS)/3.png \
$(ASSETS)/4.png \
$(ASSETS)/5.png \
$(ASSETS)/6.png \
$(ASSETS)/7.png \
$(ASSETS)/8.png \
$(ASSETS)/9.png \
BINARIES= $(BINDIR)/megabasic64.prg \
$(BINDIR)/megabanner.tiles \
$(BINDIR)/vehicle_console.tiles \
$(BINDIR)/fonttest.tiles \
$(BINDIR)/dialer.tiles
MEGABASICOBJS= $(SRCDIR)/mega-basic64.o
TOOLDIR= $(SRCDIR)/tools
TOOLS= $(TOOLDIR)/pngtoscreens
all: $(TOOLS) $(BINDIR)/MEGABAS.D81
# c-programs
tools: $(TOOLS)
%.o: %.s $(BINDIR)/megabanner.tiles $(BINDIR)/dialer.tiles
$(CA65) $< -l $*.list
$(BINDIR)/megabanner.tiles: $(TOOLDIR)/mktileset $(ASSETS)/mega65_320x64.png
$(TOOLDIR)/mktileset $(BINDIR)/megabanner.tiles c64palette $(ASSETS)/mega65_320x64.png
$(BINDIR)/vehicle_console.tiles: $(TOOLDIR)/mktileset $(VEHICLE_ASSETS)
$(TOOLDIR)/mktileset $(BINDIR)/vehicle_console.tiles c64palette $(VEHICLE_ASSETS)
$(BINDIR)/fonttest.tiles: $(TOOLDIR)/mktileset
$(TOOLDIR)/mktileset $(BINDIR)/fonttest.tiles c64palette /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf:0:16:41-5A,61-7A,20
$(BINDIR)/dialer.tiles: $(TOOLDIR)/mktileset $(DIALER_ASSETS)
$(TOOLDIR)/mktileset $(BINDIR)/dialer.tiles c64palette $(DIALER_ASSETS)
$(BINDIR)/megabasic64.prg: $(MEGABASICOBJS) $(BINDIR)/megabanner.tiles
mkdir -p $(BINDIR)
$(LD65) $< --mapfile $*.map -o $(BINDIR)/megabasic64.prg
$(BINDIR)/vehicle-console.prg: src/vehicle-console.a65 $(BINDIR)/vehicle_console.tiles
$(OPHIS) src/vehicle-console.a65
MKTILESET_SRCS= $(TOOLDIR)/mktileset.c \
$(TOOLDIR)/mktileset_png.c \
$(TOOLDIR)/mktileset_ttf.c
MKTILESET_HDRS= $(TOOLDIR)/mktileset.h
$(TOOLDIR)/mktileset: $(MKTILESET_SRCS) $(MKTILESET_HDRS) Makefile
$(CC) $(COPT) `pkg-config --cflags freetype2` -I/usr/local/include -L/usr/local/lib -o $(TOOLDIR)/mktileset $(MKTILESET_SRCS) -lpng `pkg-config --libs freetype2`
$(BINDIR)/MEGABAS.D81: $(BINARIES)
rm -f $(BINDIR)/MEGABAS.D81
cbmconvert -D8 $(BINDIR)/MEGABAS.D81 $(BINARIES)
clean:
rm -f $(TOOLDIR)/mktileset $(BINDIR)/* src/*.o src/tools/*.o
cleangen: