-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
151 lines (118 loc) · 5.4 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# This makefile is now set up so that the build system in AWS can use it. If
# you want to build the PDFs locally, then you'll want to read through all
# the comments carefully.
#
# To generate all the music for the band binder
# `make` (since the binder is the first target).
#
# YEAR is the year for which this project builds the binder
YEAR=2025
RM = rm
# The command which will be called with an ABC file as the one argument and which
# will generate the PostScript file.
ABC = abcm2ps -p -O =
# The command which will convert the PostScript file to a PDF file. On Mac OSX, the
# utility pstopdf ships with the operating system and is located at /usr/bin/pstopdf
# while non-Mac systems will generally have to install something else, such as
# GhostScript. GhostScript provides ps2pdf.
PDF = ps2pdf
# This python script ships with Mac OS X and is probably found
# at /System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py
# Add it to your $PATH, or create a symlink to it on your $PATH, or change
# the location here.
# If you have installed GhostScript, then you can use that to join the PDFs:
# gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
#
# JOIN = join.py --output
JOIN = gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=
# The source files for all the music
G3MEDLEY = g3_medley_2024.abc g3_medley_2024_harmonies.abc
G3NEWMSR = g3_msr_2025.abc
G368 = MarchOfTheRBL.abc Bengullion.abc john_barclay.abc
G3MARCHES = Killiecrankie.abc wee_michaels.abc
G3MISC = grans.abc banks_of_the_lossie.abc tune_for_lottie.abc
G3HORNPIPES = g3_hornpipes.abc
G4MEDLEY = g4_medley_2025.abc
G4MSR = g4_msr_2025.abc
G4MARCHES = dream_valley.abc Killiecrankie.abc wee_michaels.abc
PARADE = banks_of_the_lossie.abc irish_set.abc MarchOfTheRBL.abc john_barclay.abc \
dream_valley.abc castle_dangerous.abc Moonstar.abc Moonstar_seconds.abc
WUSPBA = amazing_grace.abc green_hills.abc battles_oer.abc bonnie_dundee.abc \
brown_haired_maiden.abc highland_laddie.abc scotland_the_brave.abc \
no_awa.abc rowan_tree.abc
CHRISTMAS = christmas_concert.abc scotland_the_brave.abc Killiecrankie.abc wee_michaels.abc dream_valley.abc banks_of_the_lossie.abc
ABCFILES = $(G3MEDLEY) $(G3NEWMSR) $(G368) $(G3HORNPIPES) $(G3MARCHES) $(G3MISC) $(G4MEDLEY) $(G4MSR) $(G4MARCHES) $(PARADE) $(WUSPBA)
PSFILES = $(ABCFILES:.abc=.ps)
PDFFILES = $(PSFILES:.ps=.pdf)
CONCERT_ABC = $(CHRISTMAS)
CONCERT_PS = $(CONCERT_ABC:.abc=.ps)
CONCERT_PDF = $(CONCERT_PS:.ps=.pdf)
WUSPBA_SECTION = wuspba.pdf
PARADE_SECTION = parade.pdf
CHRISTMAS_SECTION = christmas.pdf
G4_SECTION = g4.pdf
G3_SECTION = g3.pdf
# What are the artifacts, and where do they go
# We use rclone to sync the artifacts to Box, since it is going to
# stop supporting WebDAV some time soon. That, in turn, means that
# we don't get to just mount box.com somewhere on the file system and
# copy our artifacts there. Instead, we use install to put the artifacts
# in place on the local file system and then we call rclone to sync the
# local files with the service.
# LOCAL_FOLDER is the local directory that we'll install files to.
# BOX_FOLDER is the full rclone specifier for the Box folder. e.g.: "svpb-box:Silicon Valley Pipe Band/sheet_music"
G3_DIR = $(LOCAL_FOLDER)/$(YEAR)/g3/
G4_DIR = $(LOCAL_FOLDER)/$(YEAR)/g4/
FULL_DIR = $(LOCAL_FOLDER)/$(YEAR)/full_band/
G3_FILES = $(G3MEDLEY) $(G3NEWMSR) $(G3MARCHES) $(G368) $(G3HORNPIPES) $(G3MISC)
G3_PS = $(G3_FILES:.abc=.ps)
G3_PDFS = $(G3_PS:.ps=.pdf)
G4_FILES = $(G4MEDLEY) $(G4MSR) $(G4MARCHES)
G4_PS = $(G4_FILES:.abc=.ps)
G4_PDFS = $(G4_PS:.ps=.pdf)
CHRISTMAS_PS = $(CHRISTMAS:.abc=.ps)
CHRISTMAS_PDFS = $(CHRISTMAS_PS:.ps=.pdf)
PARADE_PS = $(PARADE:.abc=.ps)
PARADE_PDFS = $(PARADE_PS:.ps=.pdf)
WUSPBA_PS = $(WUSPBA:.abc=.ps)
WUSPBA_PDFS = $(WUSPBA_PS:.ps=.pdf)
# What's the install tool
INSTALL = /usr/bin/install
INSTALL_FLAGS = -C
INSTALL_DIR_FLAGS = -d
# the binder PDF
BINDER = $(YEAR)_binder.pdf
$(BINDER): $(G3_SECTION) $(G4_SECTION) $(PARADE_SECTION) $(WUSPBA_SECTION)
$(JOIN)$(BINDER) $(G3_SECTION) $(G4_SECTION) $(PARADE_SECTION) $(WUSPBA_SECTION)
install_concert: $(CHRISTMAS_SECTION)
$(INSTALL) $(INSTALL_FLAGS) $(CHRISTMAS_SECTION) $(FULL_DIR)
$(G3_SECTION): $(G3_PDFS)
perl scripts/section_titles.pl g3_section.pdf "Grade 3 Tunes"
$(JOIN)$(G3_SECTION) g3_section.pdf $(G3_PDFS)
$(G4_SECTION): $(G4_PDFS)
perl scripts/section_titles.pl g4_section.pdf "Grade 4 Tunes"
$(JOIN)$(G4_SECTION) g4_section.pdf $(G4_PDFS)
$(PARADE_SECTION): $(PARADE_PDFS)
perl scripts/section_titles.pl parade_section.pdf "Parade Tunes"
$(JOIN)$(PARADE_SECTION) parade_section.pdf $(PARADE_PDFS)
$(WUSPBA_SECTION): $(WUSPBA_PDFS)
perl scripts/section_titles.pl wuspba_section.pdf "Massed Bands / WUSPBA"
$(JOIN)$(WUSPBA_SECTION) wuspba_section.pdf $(WUSPBA_PDFS)
$(CHRISTMAS_SECTION): $(CHRISTMAS_PDFS)
perl scripts/section_titles.pl christmas_section.pdf "Christmas Concert Tunes"
$(JOIN)$(CHRISTMAS_SECTION) christmas_section.pdf $(CHRISTMAS_PDFS)
%.ps: %.abc style.abh
-$(ABC) $<
%.pdf: %.ps
$(PDF) $<
clean:
-$(RM) *.ps *.pdf
dist : clean $(BINDER)
-$(RM) *.ps
install : $(BINDER)
$(INSTALL) $(INSTALL_DIR_FLAGS) $(FULL_DIR) $(G3_DIR) $(G4_DIR)
$(INSTALL) $(INSTALL_FLAGS) $(BINDER) $(FULL_PDFS) $(FULL_DIR)
$(INSTALL) $(INSTALL_FLAGS) $(G3_SECTION) $(G3_DIR)
$(INSTALL) $(INSTALL_FLAGS) $(G4_SECTION) $(G4_DIR)
sync : install install_concert
rclone sync "$(LOCAL_FOLDER)/$(YEAR)" "$(BOX_FOLDER)/$(YEAR)" --checksum