diff --git a/02.variables/.gitignore b/02.variables/.gitignore new file mode 100644 index 0000000..f96b838 --- /dev/null +++ b/02.variables/.gitignore @@ -0,0 +1,4 @@ +/file1 +/file2 +/file3 +/file4 diff --git a/02.variables/Makefile b/02.variables/Makefile new file mode 100644 index 0000000..a8b5f6f --- /dev/null +++ b/02.variables/Makefile @@ -0,0 +1,24 @@ +# It apparently is a somewhat odd how vairables handle quotes and single quotes +# there is the whole documentation about differnces of "=" ":=" "?=" .. +# http://www.gnu.org/software/make/manual/make.html#Reading-Makefiles +VAR1="asdas gu" +VAR2=asdas agu +VAR3=asdas agu +# according to https://stackoverflow.com/a/649255/1711186 it is not possible to +# have newlines being part of a Makefile variable +VAR4='asdas \ +agu' + +all: file1 file2 file3 file4 + +file1: + echo $(VAR1) > $@ + +file2: + echo $(VAR2) > $@ + +file3: + echo "$(VAR3)" > $@ + +file4: + echo "$(VAR4)" > $@