# Compiler and assembler invocation.
DEFINES =
WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers
-CFLAGS = -g -MMD -msoft-float -O
+CFLAGS = -g -msoft-float -O
CPPFLAGS = -nostdinc -I$(SRCDIR) -I$(SRCDIR)/lib
-ASFLAGS = -Wa,--gstabs -MMD
+ASFLAGS = -Wa,--gstabs
LDFLAGS =
+DEPS = -MMD -MF $(@:.o=.d)
%.o: %.c
- $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES)
+ $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES) $(DEPS)
%.o: %.S
- $(CC) -c $< -o $@ $(ASFLAGS) $(CPPFLAGS) $(DEFINES)
+ $(CC) -c $< -o $@ $(ASFLAGS) $(CPPFLAGS) $(DEFINES) $(DEPS)