Naze32 clone with Frysky receiver
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

makefile 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. OBJ = $(addprefix $(BUILDDIR)/, $(SRC:.c=.o))
  19. CARGS = -mmcu=$(MCU)
  20. CARGS += -I$(EXTRAINCDIR)
  21. CARGS += -Os
  22. CARGS += -funsigned-char
  23. CARGS += -funsigned-bitfields
  24. CARGS += -fpack-struct
  25. CARGS += -fshort-enums
  26. CARGS += -Wall -pedantic -Wstrict-prototypes -Wshadow
  27. CARGS += -Wpointer-arith -Wcast-qual -Wextra
  28. CARGS += -Wno-main -Wno-write-strings -Wno-unused-parameter
  29. CARGS += -std=$(CSTANDARD)
  30. CARGS += -DF_CPU=$(F_CPU)
  31. CARGS += -ffunction-sections
  32. LINKER = -Wl,--relax
  33. PROGRAMMER = avrisp2
  34. ISPPORT = usb
  35. TARGET = rx
  36. all: $(BUILDDIR)/$(TARGET).hex
  37. $(BUILDDIR)/%.o: %.c
  38. @$(MKDIR) $(BUILDDIR)/$(dir $<)
  39. $(GCC) -c $< -o $@ $(CARGS)
  40. $(BUILDDIR)/$(TARGET).elf: $(OBJ)
  41. $(GCC) $(CARGS) $(OBJ) --output $@ $(LINKER) -Wl,-Map -Wl,$(@:.elf=.map)
  42. $(SIZE) $@
  43. $(BUILDDIR)/$(TARGET).hex: $(BUILDDIR)/$(TARGET).elf
  44. $(OBJCOPY) -O ihex $< $@
  45. $(OBJDUMP) -h -S $< > $(@:.hex=.lss)
  46. program: $(BUILDDIR)/$(TARGET).hex
  47. $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P $(ISPPORT) -e -U $(TARGET).hex
  48. clean:
  49. $(RM) $(BUILDDIR)