Makefile.test/02.variables/Makefile

24 lines
565 B
Makefile

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