It depends on the size of the asteroid and on a deliberate choice not to target the colony with a nuclear weapon.
I'd prefer a self-sustaining colony on the Moon before attempting Mars. There we can perfect our tools because, on Mars, if you screw up, you'll have to wait at least six months for your rescue mission.
actually, it would be way more complex to establish a self-sufficient colony on the moon. The moon lacks a lot of basic resources that mars provides, albeit in different ratios than earth does.
The Moon and Mars are very different worlds, but there are many reasons, local resources excepted, building a Moon colony should be easier. Lower gravity, no atmosphere and abundant solar energy should make metallurgy easy. The 3 light-second RTT may make telerobotics viable and allow some construction workers to have short commutes and to sleep at their homes.
However, the lack of any hydrology on the surface of the moon means that ore veins will no exist, at least not at any level of purity that would warrant extraction. On Earth and Mars, running water has sorted minerals for us. The only thing you could really consistently 'mine' is He3 for fusion powerplants that don't yet exist, and oxygen + silicon/iron/calcium from the regolith. Hydrogen will have to be imported if anything useful is to be made, and it is cheaper to send hydrogen from Mars than it is to send it from Earth (if you can stand to wait a few months from shipment to delivery).
I'd prefer a self-sustaining colony on the Moon before attempting Mars. There we can perfect our tools because, on Mars, if you screw up, you'll have to wait at least six months for your rescue mission.