You can put them all in prison for as many years as you like. Here in Spain we receive a steady influx of immigrants from Africa.
You hear in the news that many of them drown trying to cross the strait of Gibraltar. You can send them back to Africa. You can put them in jail.
If living in your country means no future, wars, or even starvation, being in jail in a civilized country or dying trying to get there is not such a bad outcome.
Unless life standards in those countries improve, you can put as many penalties as you want, they'll keep on coming.
Daniel