forked from argos-research/client-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from malsami/makefileintegration
Makefileintegration
- Loading branch information
Showing
5 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,114 @@ | ||
# will setup everything for demonstration in vagrant | ||
all: distributor genode binaries #datageneration | ||
# should clone all the repos and build an operating system for pbxa9, then should vagrant up | ||
make vagrant | ||
all: | ||
# should clone all the repos and build an operating system for pbxa9, then should vagrant up | ||
-make venv | ||
make distributor-init | ||
make genode-init | ||
make binaries OS-TARGET=focnados_pbxa9 | ||
make datageneration | ||
#-make packages | ||
-make vagrant | ||
|
||
distributor: taskgen | ||
# should clone the distributor_service repo and install dependencies (including the taskgen) | ||
@git submodule update --init --remote distributor_service | ||
# todo install dependencies in pyenv | ||
distributor-init: taskgen-init | ||
# clones the distributor_service repo and installs dependencies in venv(including the taskgen) | ||
@-make venv | ||
@git submodule update --init --remote distributor | ||
@-bash -c "source malsami/bin/activate; pip3 install -r ./distributor/requirements.txt > /dev/null ; deactivate" | ||
|
||
taskgen: | ||
# should clone taskgen repo and install dependencies | ||
taskgen-init: | ||
# should clone taskgen repo, there are no dependencies | ||
@git submodule update --init --remote taskgen | ||
# todo install dependencies in pyenv | ||
|
||
datageneration: | ||
# should clone datageneration and install dependencies | ||
datageneration-init: | ||
# clones datageneration and installs dependencies in venv | ||
@-make venv | ||
@git submodule update --init --remote datageneration | ||
# todo install dependencies in pyenv | ||
@-bash -c "source malsami/bin/activate; pip3 install -r ./datageneration/requirements.txt > /dev/null ; deactivate" | ||
|
||
genode: | ||
genode-init: | ||
# should clone operating system and build genode for specified arg | ||
@git submodule update --init --remote operating-system | ||
cd operating-system; make packages | ||
|
||
binaries:#takes target as arg | ||
# should build operating system and taskbinaries and put them into the bin folder in client-tools | ||
cd operating-system; ./setup.sh focnados_pbxa9 # should take target | ||
binaries: | ||
# TARGET=focnados_pbxa9, focnados_panda, focnados_... | ||
# should build operating system and taskbinaries and put them into ./bin | ||
ifdef OS-TARGET | ||
cd operating-system; ./setup.sh $(OS-TARGET) | ||
else | ||
@echo "there was no target, provide one via 'OS-TARGET=...'" | ||
endif | ||
|
||
vagrant: | ||
@vagrant up | ||
@vagrant ssh | ||
venv: notInVagrant | ||
#this installs python3-venv (if not already installed) and creates a venv called malsami | ||
make install-PKG PKG=python3-venv ASK=NO | ||
python3 -m venv malsami | ||
@bash -c "source malsami/bin/activate; pip3 install --upgrade pip ; deactivate" | ||
|
||
#dependencies: dependencies-confirm | ||
#should install the dependencies for the whole setup in pyenv | ||
inVagrant: | ||
# is successful if user is vagrant or ubuntu | ||
@if [ $(USER) = "ubuntu" ] || [ $(USER) = "vagrant" ]; then \ | ||
true; \ | ||
else \ | ||
false; \ | ||
fi | ||
|
||
#dependencies-confirm: | ||
#@( read -p "This will install qemu12, bridge-utils, screen, isc-dhcp-server, htop, pkg-config, zlib1g-dev, libglib2.0, libpixman-1.0, libpixman-1-dev Are you sure?!? [Y/n]: " sure && case "$$sure" in [nN]) false;; *) true;; esac ) | ||
notInVagrant: | ||
# is successful if NOT in the directory /vagrant | ||
@PATH=$$(pwd); \ | ||
if [ "$$PATH" = "/vagrant" ]; then \ | ||
false; \ | ||
else \ | ||
true; \ | ||
fi | ||
|
||
vagrant: notInVagrant | ||
# installs vagrant (if not already installed) and starts the vagrant machine and logs into it | ||
make install-PKG PKG=vagrant ASK=NO | ||
vagrant up | ||
vagrant ssh | ||
|
||
install-PKG: install-PKG-confirm | ||
ifdef PKG | ||
@PKG_IS_INSTALLED=$$(dpkg-query -W --showformat='$${Status}\n' $(PKG)|grep "install ok installed"); \ | ||
if [ -z "$$PKG_IS_INSTALLED" ]; then \ | ||
echo "$(PKG) is not installed yet, will install ..."; \ | ||
sudo apt-get --force-yes --yes install $(PKG); \ | ||
else \ | ||
echo "$(PKG) is already installed"; \ | ||
fi | ||
else | ||
@echo "PKG missing, declare package like PKG='package'" | ||
endif | ||
|
||
install-PKG-confirm: | ||
#asks for permission to install if ASK is not YES | ||
ifdef PKG | ||
ifeq ($(ASK), YES) | ||
@( read -p "This will install $(PKG) Are you sure?!? [Y/n]: " sure && case "$$sure" in [nN]) false;; *) true;; esac ) | ||
else | ||
true | ||
endif | ||
else | ||
@echo "PKG missing, declare package like PKG='package'" | ||
false | ||
endif | ||
|
||
packages: notInVagrant | ||
sudo apt-get update -qq | ||
@for pkg in python3.5 python3-pip bridge-utils screen isc-dhcp-server htop pkg-config zlib1g-dev libglib2.0 libpixman-1.0 libpixman-1-dev; do \ | ||
echo "$$pkg"; \ | ||
make install-PKG PKG="$$pkg" ASK=NO ; \ | ||
done | ||
|
||
qemu: | ||
# compile qemu | ||
@QEMU_VERSION=2.12.0; \ | ||
mkdir -p $$HOME/Downloads/QEMU; \ | ||
cd $$HOME/Downloads/QEMU; \ | ||
wget -q https://download.qemu.org/qemu-$$QEMU_VERSION.tar.xz; \ | ||
tar xvJf qemu-$$QEMU_VERSION.tar.xz; \ | ||
cd qemu-$$QEMU_VERSION; \ | ||
./configure --target-list=arm-softmmu; \ | ||
make; \ | ||
sudo cp arm-softmmu/qemu-system-arm /usr/local/bin/ |
Submodule distributor
added at
cd8867
Submodule distributor_service
deleted from
c259f1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters