+2018-02-20  Alan Hayward  <alan.hayward@arm.com>
+           Simon Marchi  <simon.marchi@ericsson.com>
+
+       * Makefile.in: Switch order of make rules.
+
 2018-02-19  Alan Hayward  <alan.hayward@arm.com>
 
        * Makefile.in: Add common directory in build.
 
        $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
        $(POSTCOMPILE)
 
-arch/%.o: ../arch/%.c
-       $(COMPILE) $<
+# Rules for objects that go in the in-process agent.
+
+arch/%-ipa.o: ../arch/%.c
+       $(IPAGENT_COMPILE) $<
        $(POSTCOMPILE)
 
-# Rules for objects that go in the in-process agent.
+common/%-ipa.o: ../common/%.c
+       $(IPAGENT_COMPILE) $<
+       $(POSTCOMPILE)
 
 %-ipa.o: %-generated.c
        $(IPAGENT_COMPILE) $<
        $(IPAGENT_COMPILE) $<
        $(POSTCOMPILE)
 
-common/%-ipa.o: ../common/%.c
-       $(IPAGENT_COMPILE) $<
-       $(POSTCOMPILE)
+# Rules for objects that go in the gdbserver binary.
 
-arch/%-ipa.o: ../arch/%.c
-       $(IPAGENT_COMPILE) $<
+arch/%.o: ../arch/%.c
+       $(COMPILE) $<
        $(POSTCOMPILE)
 
-# Rules for objects that go in the gdbserver binary.
-
-%.o: %-generated.c
+common/%.o: ../common/%.c
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-%.o: %.c
+%.o: %-generated.c
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-common/%.o: ../common/%.c
+%.o: %.c
        $(COMPILE) $<
        $(POSTCOMPILE)