From 14e930668ac87a55459a08d98a91df1dac2b3a2c Mon Sep 17 00:00:00 2001
From: Steven H Johnson <shjohnson.pi@gmail.com>
Date: Mon, 19 Nov 2018 19:16:48 -0500
Subject: [PATCH] Add root Makefile and allow creating a tar.gz.

---
 .gitignore |  1 +
 INSTALL    |  9 +++++++++
 Makefile   | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+)
 create mode 100644 INSTALL
 create mode 100644 Makefile

diff --git a/.gitignore b/.gitignore
index 4dece58..1e969ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ a.out
 src/quad_solver
 *.o
 *.out
+*.tar.gz
 
 # Ignore spike compiled files.
 spikes/ieee_floating_point/float
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..7bfcf58
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,9 @@
+To build and run Quad Solver, simply run the following commands from the top directory:
+
+ $ make
+
+ $ ./src/quad_solver
+
+To run all tests, run:
+
+ $ make test
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6434586
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+# Root Makefile for Quad Solver
+VERSION = 1.0
+PROGRAM_NAME = quad-solver
+FILE_LIST = \
+	LICENSE \
+	Makefile \
+	readme.md \
+	documents \
+	src \
+	tests \
+	spikes \
+	stories
+
+.PHONY: build distribute test clean
+
+default: build
+
+distribute:
+	make -C src clean
+	make -C tests clean
+	rm -rf $(PROGRAM_NAME)-$(VERSION)
+	mkdir -p $(PROGRAM_NAME)-$(VERSION)
+	cp -R $(FILE_LIST) $(PROGRAM_NAME)-$(VERSION)
+	tar cf - $(PROGRAM_NAME)-$(VERSION) | gzip -9c > $(PROGRAM_NAME)-$(VERSION).tar.gz
+	rm -rf $(PROGRAM_NAME)-$(VERSION)
+
+build:
+	make -C src
+	@echo "Binary created at src/quad_solver"
+
+test:
+	make -C src
+	make -C tests
+
+clean:
+	make -C src clean
+	make -C tests clean
\ No newline at end of file
-- 
GitLab