Write generated files to separate directory
diff --git a/xos/configurations/common/Makefile.cloudlab b/xos/configurations/common/Makefile.cloudlab
index af2ec58..8a73e8e 100644
--- a/xos/configurations/common/Makefile.cloudlab
+++ b/xos/configurations/common/Makefile.cloudlab
@@ -1,35 +1,38 @@
 MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' )
 MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' )
+SETUPDIR:=./setup
 
-all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key
+all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url other_keys
 
 prereqs:
 	make -f Makefile.prereqs
+	mkdir -p $(SETUPDIR)
 
 admin-openrc:
-	sudo cat /root/setup/admin-openrc.sh > admin-openrc.sh
-	sudo cat /root/setup/settings > controller_settings
-	echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> controller_settings
+	sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh
+	sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings
+	echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings
 
 flat_name:
-	sudo bash -c "source /root/setup/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > flat_net_name
-	[ -s flat_net_name ] # throw error if flat_net_name is empty
+	bash -c "source $(SETUPDIR)/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name
+	[ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty
 
 nodes_yaml:
-	bash ./make-nodes-yaml.sh
+	bash ./make-nodes-yaml.sh > $(SETUPDIR)/nodes.yaml
 
 ceilometer_url:
-	echo http://`hostname -i`/xosmetering/ > ceilometer_url
+	echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url
 
 public_key: ~/.ssh/id_rsa.pub
-	cp ~/.ssh/id_rsa.pub .
+	cp ~/.ssh/id_rsa.pub $(SETUPDIR)
 
 private_key: ~/.ssh/id_rsa
-	cp ~/.ssh/id_rsa .
+	cp ~/.ssh/id_rsa $(SETUPDIR)
 
 ~/.ssh/id_rsa.pub:
 	cat /dev/zero | ssh-keygen -q -N ""
 
-node_key:
-	sudo cat /root/setup/id_rsa > node_key
-	sudo cat /root/setup/id_rsa.pub > node_key.pub
+other_keys: public_key private_key
+	sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key
+	sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub
+	sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/padmin_public_key
diff --git a/xos/configurations/common/Makefile.devstack b/xos/configurations/common/Makefile.devstack
index f969b3d..3ba71ae 100644
--- a/xos/configurations/common/Makefile.devstack
+++ b/xos/configurations/common/Makefile.devstack
@@ -1,38 +1,40 @@
 # This shouldn't be hardcoded
 DEVSTACK_ROOT:=~/devstack
+SETUPDIR:=./setup
 
 all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key net_fix
 
 prereqs:
 	make -f Makefile.prereqs
 	sudo pip install httpie --upgrade
+	mkdir -p $(SETUPDIR)
 
 admin-openrc:
-	bash ./devstack-creds.sh $(DEVSTACK_ROOT) > admin-openrc.sh
-	touch controller_settings
+	bash ./devstack-creds.sh $(DEVSTACK_ROOT) > $(SETUPDIR)/admin-openrc.sh
+	touch $(SETUPDIR)/controller_settings
 
 flat_name:
-	echo private|tr -d '\n' > flat_net_name
+	echo private|tr -d '\n' > $(SETUPDIR)/flat_net_name
 	bash -c "source admin-openrc.sh; openstack network set --share private"
 
 nodes_yaml:
-	bash ./make-nodes-yaml.sh
+	bash ./make-nodes-yaml.sh > $(SETUPDIR)/nodes.yaml
 
 ceilometer_url:
-	echo http://`hostname -i`/xosmetering/ > ceilometer_url
+	echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url
 
 public_key: ~/.ssh/id_rsa.pub
-	cp ~/.ssh/id_rsa.pub .
+	cp ~/.ssh/id_rsa.pub $(SETUPDIR)
 
 private_key: ~/.ssh/id_rsa
-	cp ~/.ssh/id_rsa .
+	cp ~/.ssh/id_rsa $(SETUPDIR)
 
 ~/.ssh/id_rsa.pub:
 	cat /dev/zero | ssh-keygen -q -N ""
 
 node_key:
-	sudo cat ~/.ssh/id_rsa > node_key
-	sudo cat ~/.ssh/id_rsa.pub > node_key.pub
+	sudo cat ~/.ssh/id_rsa > $(SETUPDIR)/node_key
+	sudo cat ~/.ssh/id_rsa.pub > $(SETUPDIR)/node_key.pub
 
 net_fix:
 	sudo devstack/net-fix.sh
diff --git a/xos/configurations/common/Makefile.opencloud b/xos/configurations/common/Makefile.opencloud
index 8bc5b93..f1ed944 100644
--- a/xos/configurations/common/Makefile.opencloud
+++ b/xos/configurations/common/Makefile.opencloud
@@ -1,36 +1,40 @@
-MYFLATLANIP:=$(shell hostname -i)
+MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' )
+MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' )
+SETUPDIR:=./setup
 
-all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key images
+all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key
 
 prereqs:
 	make -f Makefile.prereqs
+	mkdir -p $(SETUPDIR)
 
 admin-openrc:
-	sudo cat /root/setup/admin-openrc.sh > admin-openrc.sh
-	sudo cat /root/setup/settings > controller_settings
-	echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> controller_settings
+	sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh
+	sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings
+	echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings
 
 flat_name:
-	echo nat-net|tr -d '\n' > flat_net_name
+	sudo bash -c "source /root/setup/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name
+	[ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty
 
 nodes_yaml:
-	bash ./make-nodes-yaml.sh
+	bash ./make-nodes-yaml.sh > $(SETUPDIR)/nodes.yaml
 
 ceilometer_url:
-	echo http://`hostname -i`/xosmetering/ > ceilometer_url
+	echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url
 
 public_key: ~/.ssh/id_rsa.pub
-	cp ~/.ssh/id_rsa.pub .
+	cp ~/.ssh/id_rsa.pub $(SETUPDIR)
 
 private_key: ~/.ssh/id_rsa
-	cp ~/.ssh/id_rsa .
+	cp ~/.ssh/id_rsa $(SETUPDIR)
 
 ~/.ssh/id_rsa.pub:
 	cat /dev/zero | ssh-keygen -q -N ""
 
 node_key:
-	sudo cat /root/setup/id_rsa > node_key
-	sudo cat /root/setup/id_rsa.pub > node_key.pub
+	sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key
+	sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub
 
 images:
 	source admin-openrc.sh; glance image-show trusty-server-multi-nic || glance image-create --name trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/acb/images/trusty-server-multi-nic.img --container-format bare