ifeq ($(findstring clean, $(MAKECMDGOALS)),)
-include $(deps)
endif
-%.o: %.c Makefile errtab.h
+
+# List osl.h in the prerequisites to make sure we generate it before attempting
+# to run the compiler. This matters only when the .d file does not exist.
+%.o: %.c osl.h Makefile errtab.h
$(CC) $(OSL_CPPFLAGS) $(CPPFLAGS) \
-c -MMD -MF $(*F).d -MT $@ \
$(OSL_CFLAGS) $(CFLAGS) $<