There are two kinds of purpose: intrinsic and extrinsic. A paintbrush has an extrinsic purpose as it facilitates the creation of a painting. It is meant to serve something outside of itself. The painting has an intrinsic purpose. It is the beauty embodied. The question of what is the meaning of life is rather flawed when one understands extrinsic versus intrinsic purpose.
Meaning is derived from either intrinsic purpose or extrinsic purpose where the subject is related to something higher. This latter relationship is an infinite regress, as that higher something must have a relationship to something else higher than itself, etc. The only way to stop this infinite regress is to have something of extrinsic purpose serve something of intrinsic purpose.
When people ask what is the meaning of life, they are in truth asking what is the meaning of everything. Obviously, there is nothing outside of everything, that is a logical contradiction and so it is in a sense a flawed question as it presupposes the existence of something outside of everything. All of this is to say, that there is either nothing of objective intrinsic value and so nothing has any objective value or there is something of intrinsic value from which everything else gains meaning via its participation in it. In essence, we are talking about the Platonic form of the Good. Where that form of intrinsic meaning sits atop the pyramid of existence and meaning flows down from it like water from a waterfall.
However, you should note that the Platonic form of the Good is in many ways merely God, written with an extra o. However, what gives the Platonic form of the Good value? What makes murder wrong? Either it’s because we say so due to the individual willing it, (a will caused by biological processes,) or something omnipotent says that murder is objectively wrong and human life objectively has value.
Nevertheless, do not forget man’s, especially men’s inability to articulate his thoughts and feelings. Verily, the question that was intended by asking what is the meaning of life, is in fact can I find meaning in life? The sense of having meaning is an actual sense and do not worry about your logical mind which will say, “Although I am happy and full of meaning, it still has no meaning because nothing is of intrinsic value,” part of being human is the tendency to self-deception and believing something if it benefits you. Thus when you live a happy and meaningful life, you won’t care if it does not have objective value or meaning. You will probably end up believing that some things have objective value even if there is not an omnipotent being to give it to them. The world’s religions and philosophies are maps to how to live a good life, which is to say how to live a meaningful life. My shortened two cents are to follow your conscience, pursue the truth, emulate the virtuous, serve something outside of yourself, and aim not for happiness or meaningfulness, as meaning and happiness are by-products of virtue.