Compare commits
No commits in common. "8a805a0636bd305bf07b7c7d59a97cce087d1dae" and "c08952ea0a6a4f85a8ef017c9b337d6f04918a0a" have entirely different histories.
8a805a0636
...
c08952ea0a
2 changed files with 4 additions and 18 deletions
6
02.variables/.gitignore
vendored
6
02.variables/.gitignore
vendored
|
@ -1,2 +1,4 @@
|
||||||
# ignore all generated file by the makefile (we prefix them with file...)
|
/file1
|
||||||
/file*
|
/file2
|
||||||
|
/file3
|
||||||
|
/file4
|
||||||
|
|
|
@ -6,11 +6,8 @@ VAR2=asdas agu
|
||||||
VAR3=asdas agu
|
VAR3=asdas agu
|
||||||
# according to https://stackoverflow.com/a/649255/1711186 it is not possible to
|
# according to https://stackoverflow.com/a/649255/1711186 it is not possible to
|
||||||
# have newlines being part of a Makefile variable
|
# have newlines being part of a Makefile variable
|
||||||
# CORRECTION there should be indeed a wat to have "newlines" be stored in a
|
|
||||||
# makefile variable see GNU make docu https://www.gnu.org/software/make/manual/html_node/Multi_002dLine.html
|
|
||||||
VAR4='asdas \
|
VAR4='asdas \
|
||||||
agu'
|
agu'
|
||||||
FILE:=file
|
|
||||||
|
|
||||||
all: file1 file2 file3 file4
|
all: file1 file2 file3 file4
|
||||||
|
|
||||||
|
@ -25,16 +22,3 @@ file3:
|
||||||
|
|
||||||
file4:
|
file4:
|
||||||
echo "$(VAR4)" > $@
|
echo "$(VAR4)" > $@
|
||||||
|
|
||||||
# Variables can be used for the target of recepies
|
|
||||||
$(FILE)-li:
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
|
|
||||||
# bottom line the use of variables might feel a bit annoying in
|
|
||||||
# paritcular for the bash/shell programmers as it uses the same
|
|
||||||
# "$" indicator but then oftentime $(VARNAME)
|
|
||||||
# it is possible to use ${VARNAME},
|
|
||||||
# as a "price" the use of $ in the "recipe" part of a rule the us of shell variabls requires
|
|
||||||
# to use $$SHELVAR
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue