If you look at the delta-v map of solar system, everything massive like planets, is not going to be hub or center of extraction of minerals for other places. Mars would sit at the bottom of gravity well and be economical sink.
Deep space mining (robotic or semi automatic) of asteroids can be economically viable, but just few relatively small asteroids would provide Earth or Mars for centuries.
But raw materials are not enough, you would need industry to build all stuff you need and maintain it. If you can't manufacture 3D printer or CNC milling machine by yourself, you need to buy it from Earth. Just being able to make cast iron is not enough, you need high-tech equipment and manufacturing for them to survive.
Making Mars self sustaining circular economy would be massive systems engineering challenge.
If the real extraction happens on asteroids, then Mars or even the moon are a better base of operations just due to the smaller gravity well. And Mars isn't without its own mineral wealth. Several that would be important for growing food.