Rework the logic around the TARGET variable

- Do not try to modify the TARGET variable
- Define useful predicates
- Do not produce a toplevel in the native-code-only case
- Use the correct dependancy generator in the native-code-only case