You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
985B

  1. ################################################################################
  2. #
  3. ################################################################################
  4. DIR_PROJECT = project
  5. SOURCE_PROJECT = \
  6. cli.c \
  7. gpio.c \
  8. spi.c \
  9. i2c.c \
  10. drivers/bmp280.c \
  11. drivers/htu21.c \
  12. sensorhub.c \
  13. info.c \
  14. usb.c \
  15. usb_uart.c \
  16. freertos_adaptations.c \
  17. main.c
  18. CFLAGS += -DTARGET_SMT32F0
  19. CFLAGS += -DICE40_LP384
  20. CFLAGS += -Iproject
  21. SOURCE += $(addprefix $(DIR_PROJECT)/,$(SOURCE_PROJECT))
  22. # Build .c files
  23. $(OUT)/$(DIR_PROJECT):
  24. @$(MKDIR) $@
  25. @$(MKDIR) $@/drivers
  26. $(OUT)/$(DIR_PROJECT)/%.o: $(DIR_PROJECT)/%.c | $(OUT)/$(DIR_PROJECT)
  27. $(VERBOSE)$(ECHO) '[CC] $<'
  28. $(VERBOSE)$(CC) $(CFLAGS) $(CFLAGS_PROJECT) -o "$@" "$<"
  29. $(OUT)/$(DIR_PROJECT)/%.d: $(DIR_PROJECT)/%.c | $(OUT)/$(DIR_PROJECT)
  30. @set -e; rm -f $@; \
  31. $(CC) $(CFLAGS) $(CFLAGS_PROJECT) -MM $< > $@.$$$$; \
  32. sed 's,\($<\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
  33. rm -f $@.$$$$; [ -s $@ ] || rm -f $@