This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (33 loc) · 1.43 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
#Generate lookup tables from source data
sourcedir := sources
targetdir := lookuptables
scriptdir := scripts
tmpdir := tmp
peopleurl := http://www.govtrack.us/data/us/113/people.xml
targetxml := $(targetdir)/acts.xml $(targetdir)/committees.xml $(targetdir)/federal-bodies.xml $(targetdir)/people.xml $(targetdir)/billversions.xml
xmlschema := entity-table.xsd
movedest := ../templates/vocabularies
.PHONY: all preview validate clean move
all: $(targetxml)
$(targetdir)/%.xml: $(tmpdir)/%.xml.tmp-unformatted
xmllint --format --output $@ $<
$(tmpdir)/billversions.xml.tmp-unformatted: $(scriptdir)/doctypes2xml.py $(sourcedir)/doctypes.txt
python $+ $@
$(tmpdir)/acts.xml.tmp-unformatted: $(scriptdir)/act-names.py $(sourcedir)/popular-names.csv
python $+ $@
$(targetdir)/committees.xml: $(scriptdir)/fix-committees.xsl $(sourcedir)/committees-subcommittees.xml
xsltproc --output $@ $+
$(tmpdir)/federal-bodies.xml.tmp-unformatted: $(scriptdir)/nistcsv2xml.py $(sourcedir)/NIST-agencies-bureaus.csv
python $+ $@
$(tmpdir)/people-govtrack.xml:
curl --compressed --time-cond $@ -o $@ $(peopleurl)
$(targetdir)/people.xml: $(scriptdir)/govtrack2cato.xsl $(tmpdir)/people-govtrack.xml
xsltproc --output $@ --stringparam source $(peopleurl) $+
preview: $(targetxml)
less -S -M $^
validate: $(targetxml) $(xmlschema)
xmllint --noout --schema $(xmlschema) $(targetxml)
clean:
rm $(tmpdir)/* $(targetxml)
move:
cp $(targetxml) $(movedest)