Naze32 clone with Frysky receiver
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

makefile 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. MCU = attiny85
  2. F_CPU = 16000000
  3. RM = rm -rf
  4. MKDIR = mkdir -p
  5. EXTRAINCDIR = include
  6. CSTANDARD = gnu99
  7. BUILDDIR = build
  8. GCC = avr-gcc
  9. SIZE = avr-size
  10. OBJCOPY = avr-objcopy
  11. OBJDUMP = avr-objdump
  12. AVRDUDE = avrdude
  13. SRC = src/main.c
  14. SRC += src/timer.c
  15. SRC += src/spi.c
  16. SRC += src/cc2500.c
  17. SRC += src/rx.c
  18. SRC += src/cppm.c
  19. OBJ = $(addprefix $(BUILDDIR)/, $(SRC:.c=.o))
  20. CARGS = -mmcu=$(MCU)
  21. CARGS += -I$(EXTRAINCDIR)
  22. CARGS += -Os
  23. CARGS += -funsigned-char
  24. CARGS += -funsigned-bitfields
  25. CARGS += -fpack-struct
  26. CARGS += -fshort-enums
  27. CARGS += -Wall -pedantic -Wstrict-prototypes -Wshadow
  28. CARGS += -Wpointer-arith -Wcast-qual -Wextra
  29. CARGS += -Wno-main -Wno-write-strings -Wno-unused-parameter
  30. CARGS += -std=$(CSTANDARD)
  31. CARGS += -DF_CPU=$(F_CPU)
  32. CARGS += -ffunction-sections
  33. LINKER = -Wl,--relax
  34. PROGRAMMER = avrisp2
  35. ISPPORT = usb
  36. TARGET = rx
  37. all: $(BUILDDIR)/$(TARGET).hex
  38. $(BUILDDIR)/%.o: %.c
  39. @$(MKDIR) $(BUILDDIR)/$(dir $<)
  40. $(GCC) -c $< -o $@ $(CARGS)
  41. $(BUILDDIR)/$(TARGET).elf: $(OBJ)
  42. $(GCC) $(CARGS) $(OBJ) --output $@ $(LINKER) -Wl,-Map -Wl,$(@:.elf=.map)
  43. $(SIZE) $@
  44. $(BUILDDIR)/$(TARGET).hex: $(BUILDDIR)/$(TARGET).elf
  45. $(OBJCOPY) -O ihex $< $@
  46. $(OBJDUMP) -h -S $< > $(@:.hex=.lss)
  47. program: $(BUILDDIR)/$(TARGET).hex
  48. $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P $(ISPPORT) -e -U $(TARGET).hex
  49. clean:
  50. $(RM) $(BUILDDIR)