-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
196 lines (143 loc) · 4.8 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
##
## Programmer: Craig Stuart Sapp <[email protected]>
## Creation Date: Sun Aug 22 05:05:29 CEST 2021
## Last Modified: Thu Sep 2 06:50:59 CEST 2021
## Syntax: GNU Makefile
## Filename: nifc-rism-records/Makefile
## vim: ts=3
##
## Description: Makefile for various actions in the
## nifc-rism-records repository.
##
.PHONY: aton-works aton-composers
##############################
##
## all -- Default action when typing "make": lists
## make targets available in this makefile.
##
all:
@echo
@echo "Makefile targets:"
@echo " make update -- Run list/download/aton targets"
@echo " make work-list -- Create list of RISM IDs to process."
@echo " make composer-list -- Create list of RISM composer IDs to process."
@echo " make download -- Download MarcXml files."
@echo " make download-works -- Download MarcXml files."
@echo " make download-composers -- Download MarcXml files."
@echo " make empty -- List missing MarcXml files."
@echo " make count -- Count number of RISM IDs."
@echo " make aton -- Convert MarcXml files to ATON files."
@echo " make genres -- Extract a list of RISM 650a records."
@echo " make work-composers -- List composers and RISM IDs counts for each."
@echo
##############################
##
## udpate -- Update list-works.txt, download any new MarcXml files
## and convert to ATON.
##
update: work-list composer-list download aton
uw: update-works
updte-work: update-works
update-works: work-list download-works aton-works
uc: update-composers
update-composer: update-composers
update-composers: composer-list download-composers aton-composers
##############################
##
## work-list -- Collate a list of RISM IDs from Humdrum digital
## scores (in a different repository).
work-list:
bin/makeRismList --popc1 ../production-chopin-first-editions/kern \
--popc2 ../production-polish-scores/krn-diplomatic/out > list-works.txt
##############################
##
## download -- Download MarcXml files if they
## have not already been downloaded (delete
## all MarcXml files to redownload with
## any updates).
##
## Downloading is done with this command:
## wget https://opac.rism.info/id/rismid/1001100269?format=marc -O - | xmllint --format -
## where 1001100269 is the RISM ID (wget and xmllint need to be installed).
##
download: download-works download-composers
dw: download-works
download-work: download-works
download-works:
bin/downloadMarcXml list-works.txt marcxml-works
dc: download-composers
download-composer: download-composesr
download-composers:
bin/downloadMarcXml list-composers.txt marcxml-composers
##############################
##
## empty -- List missing MarcXml files based on
## the list of RISM IDs in list-works.txt. If there
## are missing files, try running "make download"
##
empty:
@bin/listEmpties list-works.txt marcxml-works
##############################
##
## count -- Count the number of RISM records lin list-works.txt.
##
count:
@wc -l list-works.txt
##############################
##
## aton -- Generate ATON versions of MarcXml files.
##
aton: aton-works aton-composers
aw: aton-works
aton-work: aton-work
aton-works:
mkdir -p aton-works
for i in marcxml-works/*.xml; \
do \
bin/marcxml2aton $$i > aton-works/$$(basename $$i .xml).aton; \
done
ac: aton-composers
aton-composer: aton-composers
aton-composers:
mkdir -p aton-composers
for i in marcxml-composers/*.xml; \
do \
bin/marcxml2aton $$i > aton-composers/$$(basename $$i .xml).aton; \
done
##############################
##
## work-composers -- Generate a list of the composers from the ATON
## version of the MARC work records, listing the number of
## entries for each composer.
##
wc: work-composers
work-composer: work-composers
work-composers:
(cd aton-works; grep -h MARC-100a * | sed 's/@MARC-100a: //' | sort | uniq -c)
##############################
##
## check-composers -- Check to see if composer names in list-composers.txt
## from the metadata spreadsheet matches to the composer names in the
## RISM MARC records for the same composer.
##
cc: check-composers
check-composer: check-composers
check-composers:
@bin/checkComposers list-composers.txt aton-composers
##############################
##
## composers -- Generate a list of the composers from the ATON
## version of the MARC records, listing the number of
## entries for each composer.
##
cl: composers-list
composer-list: composers-list
composers-list:
bin/makeRismComposerList > list-composers.txt
##############################
##
## genres -- Generate a list of the RISM 650a entries, sorted
## by most common first.
##
genres:
grep -h MARC-650a aton-works/* | sed 's/^[^:]*: *//' | sortcount