build/pymake/tests/define-directive.mk

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 define COMMANDS
michael@0 2 shellvar=hello
michael@0 3 test "$$shellvar" != "hello"
michael@0 4 endef
michael@0 5
michael@0 6 define COMMANDS2
michael@0 7 shellvar=hello; \
michael@0 8 test "$$shellvar" = "hello"
michael@0 9 endef
michael@0 10
michael@0 11 define VARWITHCOMMENT # comment
michael@0 12 value
michael@0 13 endef
michael@0 14
michael@0 15 define TEST3
michael@0 16 whitespace
michael@0 17 endef
michael@0 18
michael@0 19 define TEST4
michael@0 20 define TEST5
michael@0 21 random
michael@0 22 endef
michael@0 23 endef
michael@0 24
michael@0 25 ifdef TEST5
michael@0 26 $(error TEST5 should not be set)
michael@0 27 endif
michael@0 28
michael@0 29 define TEST6
michael@0 30 define TEST7
michael@0 31 random
michael@0 32 endef
michael@0 33 endef
michael@0 34
michael@0 35 ifdef TEST7
michael@0 36 $(error TEST7 should not be set)
michael@0 37 endif
michael@0 38
michael@0 39 define TEST8
michael@0 40 is this # a comment?
michael@0 41 endef
michael@0 42
michael@0 43 ifneq ($(TEST8),is this \# a comment?)
michael@0 44 $(error TEST8 value not expected: $(TEST8))
michael@0 45 endif
michael@0 46
michael@0 47 # A backslash continuation "hides" the endef
michael@0 48 define TEST9
michael@0 49 value \
michael@0 50 endef
michael@0 51 endef
michael@0 52
michael@0 53 # Test ridiculous spacing
michael@0 54 define TEST10
michael@0 55 define TEST11
michael@0 56 baz
michael@0 57 endef
michael@0 58 define TEST12
michael@0 59 foo
michael@0 60 endef
michael@0 61 endef
michael@0 62
michael@0 63 all:
michael@0 64 $(COMMANDS)
michael@0 65 $(COMMANDS2)
michael@0 66 test '$(VARWITHCOMMENT)' = 'value'
michael@0 67 test '$(COMMANDS2)' = 'shellvar=hello; test "$$shellvar" = "hello"'
michael@0 68 test "$(TEST3)" = " whitespace"
michael@0 69 @echo TEST-PASS

mercurial