From 67d51d09a7be830bf5e8df4b6b6d68ed77e95e5e Mon Sep 17 00:00:00 2001 From: test2 Date: Tue, 10 Mar 2020 23:26:59 +0200 Subject: [PATCH] make all --- index.adoc | 59 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/index.adoc b/index.adoc index 33ba22d..8cd0421 100644 --- a/index.adoc +++ b/index.adoc @@ -64,48 +64,55 @@ structure. [source,bash] ---- swarmlab/ -├── run -├── runafter -└── runbefore +├── Makefile +├── .. +└── .. ---- -===== runbefore +You need a file called a **Makefile** to tell make what to do. +The makefile tells make how to compile and link a program, it can also tell make how to run miscellaneous commands when explicitly asked (for example, to remove certain files as a clean-up operation) -Lab_Instance dependencies. **"runbefore"** allows you to automatically pull-in other dependencies when using a Lab_Instance service. +**Makefile** is executed with the make command, e.g. -This file should contain a list of tasks and parameters to insert before the specified repos are executed on Lab_Instance. - -===== run - -Contains the main list of tasks to be executed by the Lab_Instance service. - -===== runafter +.make all +[source,bash] +---- +if [ -d swarmlab ]; then + cd swarmlab + make all +fi +---- -**"runafter"** is the machanism that allows you to to permanently save your data. +===== Makefile -Lab_Instances are mortal, and it’s pretty much routine them to be stoped and deleted. +Lab_Instance dependencies. **"Makefile"** allows you to automatically pull-in other dependencies when using a Lab_Instance service. -If you have something like a data/log file that needs to be saved then at this point make sure to back it up! +This file should contain a list of tasks and parameters to insert before the specified repos are executed on Lab_Instance and a list of tasks to be executed by the Lab_Instance service. -[NOTE] -==== -You can use any Script Programming Language you want to automate the execution of Lab_Instance service - -The shebang **MUST** be in the first line - -.e.g. +.Directory_Structure [source,bash] ---- -#!/usr/bin/perl +all: hello_world generate clean + +hello_world: + @echo "Hello World" -use strict; -use warnings; +generate: + @echo "Creating empty text files..." + touch file-{1..10}.txt -print "hello world!\n"; +clean: + @echo "Cleaning up..." + rm *.txt ---- +more info https://www.gnu.org/software/make/manual/html_node/index.html#toc-Overview-of-make[Gnu make] + +[NOTE] +==== +A simple example can be found https://git.swarmlab.io:3000/swarmlab/examples-mpi[here] ====