File indexing completed on 2024-05-19 15:23:18

0001 # comment
0002 
0003 include Makefile.in
0004 -include Makefile.doesntexist
0005 
0006 .PHONY: all
0007 
0008 all: target
0009 
0010 foo = bar $(var) \
0011     $(baz) quux
0012 
0013 ifeq ($(CC),gcc)
0014     bla=$(call func,param1,param2)
0015 else ifeq "x" "y"
0016     $(error this seems wrong)
0017 else
0018     libs=$(normal_libs)
0019 endif
0020 
0021 target1:
0022         error
0023 
0024 target2: bla.cpp $@
0025         $(CC) bla.c -o bla.o
0026         $(CC) bla.o $< \
0027             -o bla.exe
0028         @echo "hello"
0029 
0030 target3: ; @echohello \
0031 world’ ; echo "hello \
0032 world"
0033         @echo "hello"
0034 
0035 target4: ; echohello \
0036 world’ ; echo "hello \
0037 world"
0038         echo "hello"
0039 
0040 # String Substitution
0041 VAR := $(ANOTHER_VAR:%=%+1)
0042 
0043 # Variable Assignment
0044 RELAXED ::= mello
0045 rempl := x
0046 foo := a b c
0047 bar := foo
0048 hello := $($(bar):a=$(rempl))
0049 my??var=value
0050 var??=value
0051 var?=value
0052 var? = value
0053 var :::= value
0054 var ::= value
0055 var += value
0056 var != value
0057   var = value\#nocomment
0058   var = value#comment
0059   var = value;value2
0060 override var = a
0061 
0062 define var :::=
0063 bar
0064 endef
0065 
0066 override define var :::=
0067 bar
0068 endef
0069 
0070 # Conditionals
0071 bar =
0072 foo = $(bar)
0073 ifdef bar
0074 frobozz = yes
0075 else ifdef foo
0076 frobozz = no
0077 endif
0078 
0079 error_type := 0
0080 check:
0081 ifeq ($(error_type),0)
0082 else ifeq ($(error_type),1)
0083 else ifeq ($(error_type),2)
0084 else ifeq ($(error_type),3)
0085 endif
0086 
0087 $(info "'")
0088 $(info '"')
0089 $(info $(??))