-$(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
-$(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
+$(obj)/os.o: CFLAGS := $(filter-out -nostdinc,\
+ $(patsubst -I%,-idirafter%,$(CFLAGS)))
+$(obj)/.depend.os: CPPFLAGS := $(filter-out -nostdinc,\
+ $(patsubst -I%,-idirafter%,$(CPPFLAGS)))