There you go! As it can be done. Brasil does this for vaccines that are both still covered by patents and those which are off-patent (patents expired of invalidated). and sell to Third World countries. Denmark's Serum Institute does similar.(I met the then-head of the Serum Institute at the Bellagio UN/WHO/Rockefeller Foundation meeting in '97). The Danish fellow was quite pleasant guy. I had never even heard of the Serum Institute before the Bellagio meetings.
India and China are big generic drug makers (even for illegal manufacture of still patent-covered drugs) and supply themselves and some Third World countries.