As written, this Makefile is BROKEN for cross-compilation — it does not use the $(CC)
variable consistently, so it cannot compile to a non-native architecture.
To fix it, change cc
to $(CC)
in the stanza for main
, i.e:
main: $(OBJ)
- gcc -o $@ $^ $(CFLAGS) $(LIBS)
+ $(CC) -o $@ $^ $(CFLAGS) $(LIBS)