What many fail to realize is that makeup is not a fix-all. Before you can have great, smooth skin with makeup, you need to get a good skincare regimen going. Since you mentioned having "flaky" skin and didn't mention any kind of diagnosed condition such as eczema or rosacea, I'm going to just assume you're a little on the dry side, so you should be cleansing with something to accomodate that. A foaming cleanser will most likely contain detergent agents, which will make you a little more dry. I suggest a cream cleanser, which is great because the richer texture is great for removing makeup and many cream cleansers can be used on the eyes, so there's no need for a 2nd makeup remover. Regular exfoliation will help to slough off the flakiness at the top layer of the skin. Since we're assuming you're a little more dry, i would use a soft scrub once or twice a week. I also agree with using a makeup primer, and I unfortunately don't recommend the MAC one. Laura Mercier has a great foundation primer, in an assortment of formulas. I would try the hydrating or the original formula. In a primer, you wanna seek something that fills in on the surface, nothing that's going to penetrate the skin because then it's not sealing off your pores from "drinking" your makeup products (which will happen if you're dry).
HTH, good luck!