Suppose you are new to make
. You just write an small
helloworld
program and try to compile it using make
.
However, when you run make
, the following error pops up.
makefile:2: *** missing separator. Stop.
Click to Solution
- Googling the error message gives you this
- Click into one entry
- Read it and you know it is due to tab/space
- Fix it by type
tab
instead ofspace
in the makefile
Some editor may automatically expand
tab
tospace
this can be found by Googletab space expand <your editor name>
After fixing the above error, you decide to study the concept of target
in the make
. Suddenly, you notice there are something odd with your target
he1lo
. It is wrong as there is a 1
instead of a l
.
However, when you try to run it with
make hello
It still works. How is that possible? Does it means make
doesn't distinguish
1
and l
?
Click to Solution
- As there are no information available, you decide to Google "make debug"
- Clicking into one entry, you learn that
make -d
will gives you more information - After trying executing
make hello -d
,make
prints out a bunch of information - Inside
make_debug_info
, you notice there is a thing calledimplicit rules
- Gooling "implicit rules make", gives you a list of them
- You learn that these rules can be disabled through
make -r
, after executing that,make
gives the expected error
$ make -r hello
make: *** No rule to make target 'hello'. Stop.