Add regression test for build directory handling to make lint target
[coreboot.git] / Makefile.inc
index ea27dd11fd82f18c9b61cc2da71e35297bd51c5d..a488a77c68a7f27181ccdd249da3287824b5c4ab 100644 (file)
@@ -64,7 +64,7 @@ define ramstage-objs_asl_template
 $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h
        @printf "    IASL       $$(subst $(top)/,,$$(@))\n"
        $(CC) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(abspath $(obj)/config.h) -I$(src) -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl
-       iasl -p $$(obj)/$(1) -tc $$(basename $$@).asl
+       cd $$(dir $$@); iasl -p $$(abspath $$(obj)/$(1)) -tc $$(notdir $$(basename $$@)).asl
        mv $$(obj)/$(1).hex $$(basename $$@).c
        $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c
        # keep %.o: %.c rule from catching the temporary .c file after a make clean
@@ -179,7 +179,7 @@ $(objutil)/%.o: $(objutil)/%.c
        @printf "    HOSTCC     $(subst $(objutil)/,,$(@))\n"
        $(HOSTCC) -MMD -I$(subst $(objutil)/,util/,$(dir $<)) -I$(dir $<) $(HOSTCFLAGS) -c -o $@ $<
 
-$(obj)/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
+$(obj)/%.ramstage.o $(abspath $(obj))/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
        @printf "    CC         $(subst $(obj)/,,$(@))\n"
        $(CC) -MMD $(CFLAGS) -c -o $@ $<
 
@@ -230,3 +230,10 @@ lint:
        done; \
        test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." &&  exit 1; }; \
        rm -f $$LINTLOG
+
+crossgcc: clean-for-update
+       $(MAKE) -C util/crossgcc build
+
+crossgcc-clean: clean-for-update
+       $(MAKE) -C util/crossgcc clean
+