diff options
-rw-r--r-- | extra/usb_updater/.gitignore | 2 | ||||
-rw-r--r-- | extra/usb_updater/Makefile | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/extra/usb_updater/.gitignore b/extra/usb_updater/.gitignore index e356628d7d..870b0817e5 100644 --- a/extra/usb_updater/.gitignore +++ b/extra/usb_updater/.gitignore @@ -1,2 +1,4 @@ gsctool usb_updater2 +*.d +*.o diff --git a/extra/usb_updater/Makefile b/extra/usb_updater/Makefile index 49b8a1af2c..fedb959356 100644 --- a/extra/usb_updater/Makefile +++ b/extra/usb_updater/Makefile @@ -41,9 +41,16 @@ LIBS_common = -lfmap all: $(PROGRAMS) +GSCTOOL_SOURCES := gsctool.c +GSCTOOL_OBJS := $(patsubst %.c,%.o,$(GSCTOOL_SOURCES)) +DEPS := $(patsubst %.c,%.d,$(GSCTOOL_SOURCES)) + # chip/g updater -gsctool: gsctool.c Makefile - $(CC) $(CFLAGS) $(CFLAGS_g) $< $(LFLAGS) $(LIBS) $(LIBS_g) -o $@ +gsctool: $(GSCTOOL_OBJS) Makefile + $(CC) $(GSCTOOL_OBJS) $(LFLAGS) $(LIBS) $(LIBS_g) -o $@ + +%.o: %.c + $(CC) $(CFLAGS) $(CFLAGS_g) -c -MMD -MF $(basename $@).d -o $@ $< # common EC code USB updater usb_updater2: usb_updater2.c Makefile @@ -52,4 +59,6 @@ usb_updater2: usb_updater2.c Makefile .PHONY: clean clean: - rm -rf $(PROGRAMS) *~ + rm -rf $(PROGRAMS) *~ *.o *.d + +-include $(DEPS) |