Do we love God as such or rather just as a means to an end? Well, trials and temptations go a long way to reveal that as Moses explains:
First Moses says that the nation was afflicted and tried by God in the desert for forty years in order that what was in its heart should become known, namely, whether it loved God with a sincere mind or for the sake of the belly.
For even we ourselves do not understand our heart (which is always open to God) very clearly, whether it serves God for the sake of the belly or not, unless we are tested by want and evils.
The faithful heart loves, believes, and serves while it struggles with want and evils just as it does in the midst of wealth and goods. The unfaithful heart, however, believes when wealth is present but draws back when evils rush in, as Ps. 78:36–37 says: “Their heart was not right with Him, and they lied to Him with the tongue.”
Martin Luther on Deuteronomy chapter 8 (LW 9, Pg.92)
He humbled you and fed you with manna, that He might make you know that man does not live by bread alone.

By the gift of manna man is shown to live by the Word of God.
What is the connection? Is manna perhaps the Word of God? By no means; but he sets forth rather amply what he had said about poverty, namely: “Before He gave you manna, He let you first suffer hunger. This He did in order to show you that even if manna never came He could nevertheless sustain you by His Word, by which He had promised that He would be to you a God who would not forsake you, who could sustain you just as He did sustain you. For faith in the Word of God, even in the midst of hunger, nourishes not only the soul but also the body, that is, as he says here, the whole man. It is impossible for one who has faith in the Word to perish, even if he eats or drinks nothing for the body. Although God does not truly forsake, since finally, in His time, He gives bodily nourishment, as He fed Elijah by means of the ravens, as He fed the widow of Zarephath, and as here He fed the fathers with manna.
Therefore when He shows that man does not live by bread alone, this pertains not only to the manna but to both conditions, namely, both to the affliction of hunger and to the abundance of manna. Thus the meaning is: God wanted to show you this goodness of His through your own experience, that in hunger you might learn to believe the Word of Him who promised, be sustained by it in hunger and not perish, and then finally by this faith receive the satisfaction of your bodily needs. All this He does in order to remove from you the idol of your belly and to teach you that the life of man does not rest in this, that the belly is provided with its bread, but that both parts belong to it, namely, soul and body. This you would never learn if your belly were always satisfied and you never learned through the Word to trust in God while your belly is in need.

In this way Christ quotes this passage in Matt. 4:4, when Satan holds before Him the care of the belly alone. Christ says: “Not by bread alone does man live,” not denying that man lives by bread, but saying that it is not solely by bread. For if bread is lacking, then he lives through the Word. When he has this by faith, then the bread must follow, even if it has to be produced from rock, or, as here, sent from heaven. Therefore when he says: “He afflicted you with famine, and tempted,” he calls them away from the belly and the care of the belly, to teach them in the midst of hunger to trust in and live by the Word. When he says: “And He gave you manna,” he shows that bread will not be lacking for those who by the Word survive in hunger. You see, therefore, that nothing but faith is taught by these words. By it we hold onto God and believe that we “have God,” as the First Commandment says.3
He commands, however, that they remember how they have been nourished in the desert both by the Word and by bread, as though he were showing and foretelling that at some time in the future they would be harassed by a similar trial of hungers. When this happens, the consolation of this example should raise them up to faith. They should know that however hunger may rage, they will be fed if only they believe the Word of promise in the First Commandment, by which God promises to be God to them, just as He says also in Ps. 37:19, 25: “And in a time of hunger you shall be satisfied. For it is impossible that the righteous be forsaken, or his seed seek bread.” He may hunger indeed, but he will not die of hunger; for hunger exercises his faith in the Word, but then faith gains food also for the body. Therefore the splendid word of Moses stands: that God deals with His own by testing them with hunger and exercising them in His Word, and then feeds the believer from the midst of heaven if it cannot be done otherwise. Thus they are to learn by experience that they should not be concerned for their belly, and that life does not lie in the things we possess or in bread but in the Word by which we become rich toward God, as the Gospel says (Luke 12:15). For while we live by the Word in the heart, we force God, as it were, to feed the belly too.
But just as He promises food to the believers, so He promises clothing too, and then also good health of the body; as He adds here, soon after the manna: “Your clothing has not failed with age, and your foot did not swell during these forty years” (v. 4). With these words He would teach them that nothing is lacking to those who live by the Word and believe, but that we shall be under the care of God in all things and through all things, just as Peter says (1 Peter 5:7): “Casting every care upon Him, because He Himself takes care of you”; and Ps. 34:10: “Those seeking God shall lack no good thing.” To understand these and similar wonderful and faithful promises of God is truly to understand the promise of the First Commandment, in which He says: “I am the Lord your God.” “Yours, yours,” He says, “who will show and display Myself to you as God and will not forsake you, if only you believe this.” All such promises depend on and flow from the First Commandment. On the other hand, not to believe them is indeed not to understand the Commandment but to have other gods.
Moses, however, applies this teaching of faith to future use in the midst of abundance, just as I said at the start of the chapter.4 In abundance they are to recall how once in the midst of want they were nourished by the Word with manna; they are to ponder this example and teaching again, and learn to trust in God for some other reason than that they have enough, are satisfied, and their belly is well provided for. Trust based on that is not a trust in God but rather in wealth and gifts which have been received. Because of such trust they forget both true trust and the Word of God, and never learn to have faith in God when they are in want. As I have said, it is a great thing and the work of a rich spirit not to forget God when affairs prosper, and to conduct yourself, with Paul, as if you had nothing, to use the world as if you did not use it (1 Cor. 7:30–31), to know how to endure want and to abound, to know how to be low and to be high (Phil. 4:12), and, with the prophet, not to attach the heart to wealth when it abounds, and not to become vain (Ps. 62:10) but to cling to God alone.
This is what Moses treats in this chapter as in the midst of abundance he sets up and presents the example of manna which was given in the midst of want, in order to call them back from the belly to the Word. Therefore he also repeats at the conclusion, after he has described future prosperity: “He brought streams forth for you from the hard rock and fed you with manna in the desert, which your fathers did not know, to chasten and try you, and afterward do you good, so that you would not say in your heart, etc.” (vv. 15–17). Is this not a stronger example—that He gave drink from the hard rock and manna in the desert—than what Christ teaches in Matt. 6:28 about the lilies of the field and birds of the air, which are cared for by God? For what would you less expect from a rock than water and drink? What less in the desert than bread and food? Why did He not give water from some green tree or cloud of the sky? Why not food from branches or roots or herbs? Why did He do this?
He did this that the immeasurable care of God for us might be praised. He is a God to us and dispenses everything bountifully also when everything is most hopeless. He is willing and able to turn a rock into your drink, a desert into your food, nakedness into beautiful clothing, poverty into wealth, death into life, shame into glory, evil into good, enemies into friends—and what not? He can give and change everything from everything, everything into everything, everything from nothing, everything into nothing. Only be concerned that you believe, and where want prevails, do not break down or be concerned. And again, where abundance prevails, do not be puffed up or carelessly forget God. Whether everything is on hand or everything is lacking, cling to your God always with the same heart, knowing that He who gives plenty will give it even when want bears down upon you. See, therefore, how fittingly and aptly Moses uses this miracle of God to explain the meaning of the First Commandment.
17. Beware lest you say in your heart: My power and the might of my hand, etc.
This he appends in order to describe the nature and source of forgetfulness about God. For when wealth abounds, the godless heart of man feels: “I have wrought these things with my own efforts.” Nor does it notice that these are simply blessings of God sometimes through our efforts, sometimes without our efforts, but never from our efforts and always given out of His free mercy. As we have taught above, He uses our effort as a mask under which He blesses us and dispenses His gifts, so that there is a place for faith.6 Otherwise we may think that our possessions have been produced by our powers or efforts; or, as he says here, we may think that “we have achieved this wealth” by the strength and vigor of our hand. But we are to remember the Lord God, that it is He Himself who grants the powers for achieving this wealth, not through our merit but because He has promised to do so.
This, then, is an outstanding passage, from which have flown many excellent sayings, such as that proverb (Prov. 10:22): “The blessing of the Lord makes rich”; likewise the psalm (136:25): “Who gives food to all flesh”; and the whole psalm of Solomon (Ps. 127:1): “Unless the Lord build the house.” The psalmist completely denies that anything is achieved or preserved by our powers, just as here, too, Moses denies that wealth is produced by our strength or the power of our hands; it is produced by God as He blesses and provides power to make the abundance, that is, wealth and substance; for this is the meaning of the Hebrew word חַיִל. Therefore the highest interpretation of the matter and the true understanding and fulfillment of the First Commandment is a faith which is neither elevated by prosperity nor cast down by adversity.
19. And if you forget the Lord your God.
Just as the promise of grace is set before believers, so is the threat of wrath before unbelievers; from both sides he draws and urges them to faith. Unbelief makes a judge and enemy out of God and the Father, just as he says here: “I testify to you that you will perish altogether.” Faith makes a God and Father out of an enemy and judge, as he said shortly before (Deut. 1:31): “Just as a man bears his son, so the Lord has borne you.” Again you will note here especially that the nation of Israel is wholly indistinguishable from those Gentiles who are to be destroyed, except for the distinction of faith, just as he says here that they will perish like those Gentiles whom the Lord will destroy before them. Therefore they have nothing of which to boast against the Gentiles—not the Law, the righteousness of works, the blood of the fathers, the miracles of God, the divine sayings, the priesthood, the kingdom, or anything else. The sentence stands: If they forget God and worship other gods, they shall perish, as if all this were nothing and they themselves were Gentiles too. For he who does not believe will be damned (Mark 16:16). But it has been said enough: “To worship strange gods is to be unbelieving and to oppose the true God.”