In the Path of the Just ch.1 Rabbi Moshe Chaim Luzzato says:
Behold, our sages, of blessed memory, have taught us that man was
created solely to rejoice in G-d and to delight in the splendor of the
Shechina (divine presence). For this is true joy, and the greatest
possible pleasure that can possibly exist. The place of this joy is,
in truth, in Olam Haba (the afterlife). For it was created expressly
for this purpose... The means which lead a person to this goal are the
commandments which the blessed G-d commanded to us... Therefore, man
was first placed in this world so that through these means prepared
for him here, he will be able to reach the place prepared for him,
namely, the afterlife, there to be sated with the good which he
acquired through these means. This is what our sages of blessed memory
said "today to do them, and tomorrow to receive their reward" (Eruvin
22:1)
No mention of Moshiach here. Just do what you're supposed to do and the rest will come when God deems fit.