Permalink
Newer
Older
100644 76 lines (59 sloc) 3.24 KB
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
1 ## ------------------------------------------------------------------
2 ## Title: Top-level build file
3 ## Description: Automated import of data and SQL scripts
4 ## ------------------------------------------------------------------
5
6 ## Parameters ##
7
8 DBNAME=mimic
9 DBUSER=mimic
10 SCHEMA=mimiciii
11 DATADIR=
12
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
13 # path of this makefile - used to locate concepts subfolder
14 ROOT_DIR:=$(shell "dirname" $(realpath $(lastword $(MAKEFILE_LIST))))
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
15
16 ## Commands ##
17
18 PSQL=psql "dbname=$(DBNAME) options=--search_path=$(SCHEMA)" --username=$(DBUSER)
19
20
21 ## Export ##
22 # Parameters given in this Makefile take precedence over those defined in each
23 # individual Makefile (due to specifying the -e option and the export command
24 # here)
25 export
26
27 ## Build targets ##
28 help:
29 @echo '---------------------------------------------------------------------------'
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
30 @echo 'mimic-download: Download data from PhysioNet'
31 @echo 'mimic-gz: Import data into a local PostgreSQL database using .csv.gz files'
32 @echo 'mimic: Import data into a local PostgreSQL database using .csv files'
33 @echo 'concepts: Create community contributed materialized views'
Sep 15, 2016 @tompollard Add download to makefile. ref #108
34 @echo '--------------------------------------------------------------------------- '
35 @echo ' Download MIMIC-III from PhysioNet to the /path/to/data/ directory - '
36 @echo ' '
37 @echo ' make mimic-download physionetuser=USERNAME datadir="/path/to/data/" '
38 @echo ' '
Sep 15, 2016 @tompollard fix example
39 @echo ' e.g. make mimic-download physionetuser=me@email.com datadir="/data/" '
Sep 15, 2016 @tompollard Add download to makefile. ref #108
40 @echo ' '
41 @echo ' Build MIMIC-III using the CSV files in the /path/to/data directory - '
42 @echo ' '
43 @echo ' make mimic datadir="/path/to/data/" '
44 @echo ' '
45 @echo ' e.g. make mimic datadir="/data/mimic/v1_4/" '
Jul 8, 2016 @jeblundell Added mimic*-gz build targets to top-level Makefile
46 @echo ' '
47 @echo ' Build MIMIC-III using the .csv.gz files in the /path/to/data directory - '
48 @echo ' '
Sep 15, 2016 @tompollard Add download to makefile. ref #108
49 @echo ' make mimic-gz datadir="/path/to/data/" '
Jul 8, 2016 @jeblundell Added mimic*-gz build targets to top-level Makefile
50 @echo ' '
Sep 15, 2016 @tompollard Add download to makefile. ref #108
51 @echo ' e.g. make mimic-gz datadir="/data/mimic/v1_4/" '
52 @echo '--------------------------------------------------------------------------- '
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
53
54 mimic: mimic-build mimic-check
Jul 8, 2016 @jeblundell Added mimic*-gz build targets to top-level Makefile
55 mimic-gz: mimic-build-gz mimic-check-gz
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
56
Sep 15, 2016 @tompollard Add download to makefile. ref #108
57 mimic-download:
58 @$(MAKE) -e -C buildmimic/postgres mimic-download
59
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
60 mimic-build:
61 @$(MAKE) -e -C buildmimic/postgres mimic-build
62
63 mimic-check:
64 @$(MAKE) -e -C buildmimic/postgres mimic-check
65
Jul 8, 2016 @jeblundell Added mimic*-gz build targets to top-level Makefile
66 mimic-build-gz:
67 @$(MAKE) -e -C buildmimic/postgres mimic-build-gz
68
69 mimic-check-gz:
70 @$(MAKE) -e -C buildmimic/postgres mimic-check-gz
71
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
72 concepts:
73 @cd $(ROOT_DIR)/concepts && $(PSQL) -f make-concepts.sql
Jul 7, 2016 @jeblundell Initial commit of top-level Makefile
74
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
75 .PHONY: help mimic mimic-build mimic-download mimic-check mimic-gz mimic-build-gz mimic-check-gz concepts