Makefile: Put the class flags after the generic flags.

The class flags are more specific than the generic CFLAGS flags and should be
after them so that they have a chance to override them. The class specific
flags weren't really used on anything but ARM so this should be a fairly safe
change even in the x86 Makefiles.

BUG=None
TEST=Built for link. Built and booted on nyan.
BRANCH=None

Change-Id: I7a949efbb1d2841f9f0d28433772092d9f95db36
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/171016
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/Makefile b/Makefile
index 9aafe7c..e2be68b 100644
--- a/Makefile
+++ b/Makefile
@@ -260,7 +260,7 @@
 de$(EMPTY)fine $(1)-objs_$(2)_template
 $(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h $(4)
 	@printf "    CC         $$$$(subst $$$$(obj)/,,$$$$(@))\n"
-	$(CC) $(3) -MMD $$$$(CFLAGS) -c -o $$$$@ $$$$<
+	$(CC) -MMD $$$$(CFLAGS) $(3) -c -o $$$$@ $$$$<
 en$(EMPTY)def
 end$(EMPTY)if
 endef
diff --git a/Makefile.inc b/Makefile.inc
index 1a732f9..7e0b44c 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -305,7 +305,7 @@
 
 $(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
-	$(CC) -MMD $(bootblock-c-ccopts) $(CFLAGS) -c -o $@ $<
+	$(CC) -MMD $(CFLAGS) $(bootblock-c-ccopts) -c -o $@ $<
 
 #######################################################################
 # Clean up rules
diff --git a/src/arch/armv7/Makefile.inc b/src/arch/armv7/Makefile.inc
index 82c3564..23c3eba 100644
--- a/src/arch/armv7/Makefile.inc
+++ b/src/arch/armv7/Makefile.inc
@@ -265,7 +265,7 @@
 	$(CC) $(bootblock-c-ccopts) $(INCLUDES) -MM \
 		-MT$(objgenerated)/bootblock.inc \
 		$< > $(objgenerated)/bootblock.inc.d
-	$(CC) $(bootblock-c-ccopts) -c -S $(CFLAGS) -I. $(INCLUDES) $< -o $@
+	$(CC) -c -S $(CFLAGS) $(bootblock-c-ccopts) -I. $(INCLUDES) $< -o $@
 
 $(objcbfs)/bootblock.debug:  $(objgenerated)/bootblock.o $(objgenerated)/bootblock.ld $$(bootblock-objs) $(stages) $(obj)/config.h
 	@printf "    LINK       $(subst $(obj)/,,$(@))\n"