aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Moch2018-02-25 07:35:44 -0500
committerDaniel Moch2018-02-25 07:35:44 -0500
commit12800fa7749e2c8876ff4fa4760913cefa9d32fe (patch)
tree1f603c0acf1a85ea2bd8cf555bf45bda71edb96a
parent4e02e4fffc511f03f512601f4c217991a386a1e7 (diff)
downloadcbr-schedule-12800fa7749e2c8876ff4fa4760913cefa9d32fe.tar.gz
Add Makefile.
Ready for merge to master
-rw-r--r--Makefile37
-rw-r--r--README.md14
2 files changed, 39 insertions, 12 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..139e46b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2018 Daniel Moch
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+SECTIONS=sections/new_testament.json sections/old_testament.json sections/psalms.json
+
+text: $(SECTIONS)
+ ./generate_schedule output.txt
+
+json: $(SECTIONS)
+ ./generate_schedule output.json
+
+clean:
+ rm output.*
+ rm sections/*.json
+
+sections/%.json: sections/%.in
+ ./generate_readings $<
diff --git a/README.md b/README.md
index 68351a1..febcaa9 100644
--- a/README.md
+++ b/README.md
@@ -23,18 +23,8 @@ Other export formats on the roadmap:
# Usage
-A Makefile would be nice, I'll get one of those up soon too. In the
-meantime, the process will be a bit manual. Take the following example:
-
-```
-./generate_readings sections/old_testament.in
-./generate_readings sections/new_testament.in
-./generate_readings sections/psalms.in
-./generate_schedule output.txt
-```
-
-The final result of these commands would be a file called `output.txt`
-that contains a formatted text file with the 2018 CBR schedule.
+1. `make text` builds a formatted text file (also built with simply `make`)
+2. `make json` builds a JSON file
# License