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:
next:
@echo "next"
all:
@echo "All"
It will print:
$ make
next
You can also change the default goal:
.DEFAULT_GOAL=other
next:
@echo "next"
all:
@echo "All"
other:
@echo "other"
It will show:
$ make
other
This is with:
$ make --version
GNU Make 3.81