Fixed-target hadroproduction of heavy quarks