This block appears broken (the TARGET_LINUX one).  Replace all the else if's with if's.