examples/test regarding variables

This commit is contained in:
Alexander Mahr 2024-12-28 14:58:29 +01:00
parent 8b8f1898ef
commit c08952ea0a
2 changed files with 28 additions and 0 deletions

4
02.variables/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
/file1
/file2
/file3
/file4

24
02.variables/Makefile Normal file
View file

@ -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)" > $@