Gary can bake 4/0.5 = <<4/0.5=8>>8 cakes from the 4 pounds of flour.
He can bake 2/ 1/5 = 10 cupcakes from the 2 pounds of flour.
So, he will earn $2.5 x 8 = $<<2.5*8=20>>20 from the cakes.
Hence, Gary will earn a total of $20 + $10 = $<<30=30>>30 from baking 8 cakes and 10 cupcakes.
#### 30