-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakevars
More file actions
66 lines (57 loc) · 2.85 KB
/
Copy pathMakevars
File metadata and controls
66 lines (57 loc) · 2.85 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
# ------------------------------------------------------------------------------
# US Census API Key
# ------------------------------------------------------------------------------
API_KEY ?= $(USCENSUSAPIKEY)
REQUIRE_API_KEY = test -n "$(API_KEY)" || { echo "API_KEY is empty. Export USCENSUSAPIKEY in your shell or set API_KEY in the Makefile." >&2; exit 1; }
RSCRIPTVANILLA ?= Rscript --vanilla
define PUBLISH_GZIP_CSV
if [ -f "$@" ] && cmp -s <(gzip -cd "$@") <(gzip -cd "$$tmp"); then \
rm -f "$$tmp"; \
else \
mv -f "$$tmp" "$@"; \
fi
endef
# ------------------------------------------------------------------------------
# Years and tables of the ACS5 to download
# ------------------------------------------------------------------------------
ACS5_YEARS := 2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012
ACS5_DATASET := acs/acs5
ACS5_TABLES := B01001 B01003 B11003 B15003 B17010 B19001 B19013 B19025 B19083 B19301 B23025 B25001 B25003 B25014 B25032 B25043 B25044 B25047 B25064 B25077 B25088 B26001 B27010 B28002 C17002 C24010
ACS5_EXCLUDE := B15003__2010 B15003__2011 \
B23025__2010 \
B27010__2010 B27010__2011 B27010__2012 \
B28002__2010 B28002__2011 B28002__2012 B28002__2013 B28002__2014 B28002__2015 B28002__2016
acs5_pairs = $(filter-out $(ACS5_EXCLUDE),$(foreach year,$(ACS5_YEARS),$(foreach tab,$(ACS5_TABLES),$(tab)__$(year))))
acs5_years_for = $(filter-out $(foreach pair,$(filter $(1)__%,$(ACS5_EXCLUDE)),$(patsubst $(1)__%,%,$(pair))),$(ACS5_YEARS))
acs5_pair_table = $(word 1,$(subst __, ,$(1)))
acs5_pair_year = $(word 2,$(subst __, ,$(1)))
# ------------------------------------------------------------------------------
# Years and tables of the Decennial Census to download
# ------------------------------------------------------------------------------
DECENNIAL_YEARS := 2020 2010
DECENNIAL_DATASET_2020 := dhc
DECENNIAL_DATASET_2010 := sf1
DECENNIAL_TABLES_2020 := P1 H1 H4 P18
DECENNIAL_TABLES_2010 := P1 H1 H4 P18 P42
decennial_dataset = $(DECENNIAL_DATASET_$(1))
decennial_tables = $(DECENNIAL_TABLES_$(1))
# ------------------------------------------------------------------------------
# Years and data sets to pull FIPS from
# ------------------------------------------------------------------------------
FIPS_YEARS := $(sort $(DECENNIAL_YEARS) 2011 $(ACS5_YEARS))
FIPS_DATASET_2024 := $(ACS5_DATASET)
FIPS_DATASET_2023 := $(ACS5_DATASET)
FIPS_DATASET_2022 := $(ACS5_DATASET)
FIPS_DATASET_2021 := $(ACS5_DATASET)
FIPS_DATASET_2020 := $(ACS5_DATASET)
FIPS_DATASET_2019 := $(ACS5_DATASET)
FIPS_DATASET_2018 := $(ACS5_DATASET)
FIPS_DATASET_2017 := $(ACS5_DATASET)
FIPS_DATASET_2016 := $(ACS5_DATASET)
FIPS_DATASET_2015 := $(ACS5_DATASET)
FIPS_DATASET_2014 := $(ACS5_DATASET)
FIPS_DATASET_2013 := $(ACS5_DATASET)
FIPS_DATASET_2012 := $(ACS5_DATASET)
FIPS_DATASET_2011 := $(ACS5_DATASET)
FIPS_DATASET_2010 := dec/sf1
fips_dataset = $(FIPS_DATASET_$(1))