-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (71 loc) · 2.62 KB
/
Makefile
File metadata and controls
91 lines (71 loc) · 2.62 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
# Enable color output in tput, used in Makefiles and scripts.
# This is theoretically bad, but in practice it's fine.
export TERM = xterm-256color
OUTDIR = out
BINDIR = bin
# --------------------------------------------------
# Build targets
# --------------------------------------------------
# Subdirectory targets
targets := desktop disk_copy selector launcher desk_acc extras
# Default target
.PHONY: all
all: vercheck $(targets)
# Unconditionally built; recursive make takes care of their
# dependencies
.PHONY: $(targets)
$(targets):
@$(MAKE) -C src/$@ \
&& echo "$$(tput setaf 2)make $@ good$$(tput sgr0)" \
|| (echo "$$(tput blink && tput setaf 1)MAKE $@ BAD$$(tput sgr0)" && false)
# --------------------------------------------------
# Package/Install targets
# --------------------------------------------------
.PHONY: mount install package shk
.WAIT:
# Populate mount/ as a mountable directory for Virtual ][
mount: $(targets) .WAIT $(OUTDIR)/mount.sentinel
@(tput setaf 2 && echo "make $@ good" && tput sgr0)
# Install to an existing disk image.
# Requires Cadius, and INSTALL_IMG and INSTALL_PATH to be set.
install: $(targets) .WAIT $(OUTDIR)/install.sentinel
@(tput setaf 2 && echo "make $@ good" && tput sgr0)
# Build disk images for distribution.
# Requires Cadius.
package: $(targets) .WAIT $(OUTDIR)/package.sentinel
@(tput setaf 2 && echo "make $@ good" && tput sgr0)
# Build ShrinkIt archive for distribution.
# Requires NuLib2.
shk: $(targets) .WAIT $(OUTDIR)/shk.sentinel
@(tput setaf 2 && echo "make $@ good" && tput sgr0)
MANIFEST = $(shell bin/manifest_list)
$(OUTDIR)/%.sentinel: $(MANIFEST) $(OUTDIR)/buildinfo.inc
@bin/$*
@touch $(OUTDIR)/$*.sentinel
# Specialization for "install" which optionally skips sample media
$(OUTDIR)/install.sentinel: $(shell no_sample_media=$$INSTALL_NOSAMPLES bin/manifest_list) $(OUTDIR)/buildinfo.inc
@bin/install
@touch $(OUTDIR)/install.sentinel
.SECONDEXPANSION:
$(OUTDIR)/%.font: res/fonts/$$(basename $$*).unicode.txt
$(BINDIR)/build_font_from_unicode_txt.pl $(subst .,,$(suffix $*)) < res/fonts/$(basename $*).unicode.txt > $@
.PRECIOUS: $(OUTDIR)/%.font
# --------------------------------------------------
# Miscellaneous
# --------------------------------------------------
# Clean all temporary/target files
clean:
@for dir in $(targets); do \
echo "$$(tput setaf 3)cleaning $$dir$$(tput sgr0))"; \
$(MAKE) -C src/$$dir clean; \
done
rm -f $(OUTDIR)/*.sentinel
# Ensure minimum cc65 version
.PHONY: vercheck
vercheck:
@bin/check_ver.pl ca65 v2.19
@bin/check_ver.pl ld65 v2.19
# Build Date
$(OUTDIR)/buildinfo.inc: FORCE
@$(BINDIR)/make_buildinfo_inc
FORCE: