Merge branch 'master' of bitbucket.org:corddesign/voltha
diff --git a/Makefile b/Makefile
index 3c70680..603aae8 100644
--- a/Makefile
+++ b/Makefile
@@ -14,9 +14,39 @@
 # limitations under the License.
 #
 
+include setup.mk
+
 VENVDIR := venv
 
-.PHONY:
+.PHONY: $(DIRS) $(DIRS_CLEAN) $(DIRS_FLAKE8) flake8
+
+## New directories can be added here
+DIRS:=\
+voltha
+
+## If one directory depends on another directory that
+## dependency can be expressed here
+##
+## For example, if the Tibit directory depended on the eoam
+## directory being built first, then that can be expressed here.
+##  driver/tibit: eoam
+
+# Parallel Build
+$(DIRS):
+	@echo "    MK $@"
+	$(Q)$(MAKE) -C $@
+
+# Parallel Clean
+DIRS_CLEAN = $(addsuffix .clean,$(DIRS))
+$(DIRS_CLEAN):
+	@echo "    CLEAN $(basename $@)"
+	$(Q)$(MAKE) -C $(basename $@) clean
+
+# Parallel Flake8
+DIRS_FLAKE8 = $(addsuffix .flake8,$(DIRS))
+$(DIRS_FLAKE8):
+	@echo "    FLAKE8 $(basename $@)"
+	$(Q)$(MAKE) -C $(basename $@) flake8
 
 default: build
 
@@ -69,3 +99,6 @@
 	@ echo "Executing all unit tests"
 	. ${VENVDIR}/bin/activate && \
 	    nosetests tests
+
+flake8: $(DIRS_FLAKE8)
+	@echo "==$(DIRS_FLAKE8)=="
diff --git a/setup.mk b/setup.mk
new file mode 100644
index 0000000..b1ccd07
--- /dev/null
+++ b/setup.mk
@@ -0,0 +1,27 @@
+#
+# Copyright 2016 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#### VERBOSE ####
+# Set V (for VERBOSE) on the comand line (make V=1) to see additional
+# output
+ifeq ("$(origin V)", "command line")
+export Q=
+else
+export Q=@
+export MAKEFLAGS+=--no-print-directory
+endif
+
+FLAKE8:=flake8
diff --git a/voltha/Makefile b/voltha/Makefile
new file mode 100644
index 0000000..846542a
--- /dev/null
+++ b/voltha/Makefile
@@ -0,0 +1,24 @@
+#
+# Copyright 2016 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+VOLTHA_BASE:=../.
+
+include $(VOLTHA_BASE)/setup.mk
+
+PYTHONFILES:=$(wildcard *.py)
+
+flake8: 
+	$(FLAKE8) --filename $(PYTHONFILES)