In the case of building multiple targets in makefile, when I say ‘make’ it by default makes all the target. Is it possible to change the default of all to something else ?
all : target1 target2
Now , when I give the command ‘make’ , i only want target1 to build.
Like Carl mentions, you can just remove target2 from the line.
However if you still want all to make target1 and target2 there are some options…
You did not say which make you were using, which on these fine details it depends on the version, but I’m going to detail how it works for GNU make.
In GNU make, the first goal becomes the default. So if you have a Makefile like:
It will print:
You can also change the default goal:
It will show:
This is with: