diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-01-19 18:45:05 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-01-19 18:45:49 +0800 |
| commit | a7644c020c4c2b72fc0f13aeea4be47ba08f1961 (patch) | |
| tree | 4eb34f3b93d81c445af49c1cf81e2ec82a50b3c4 /aliznayem/Recv.Makefile | |
| parent | 4c0557793d80cbcc6575b83db9cb3a44feeca229 (diff) | |
| download | smart-home-a7644c020c4c2b72fc0f13aeea4be47ba08f1961.tar.gz | |
Try with aliznayem C port (no luck).
Diffstat (limited to 'aliznayem/Recv.Makefile')
| -rw-r--r-- | aliznayem/Recv.Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/aliznayem/Recv.Makefile b/aliznayem/Recv.Makefile new file mode 100644 index 0000000..8bf16b8 --- /dev/null +++ b/aliznayem/Recv.Makefile @@ -0,0 +1,43 @@ +CC = avr-gcc +MCU = atmega328p +TARGET = recv + +SRC = RFM69.c gateway.c spi.c get_millis.c serial.c +OBJ = $(SRC:.c=.o) + +CFLAGS = -std=gnu99 +CFLAGS += -Os +CFLAGS += -Wall +CFLAGS += -mmcu=$(MCU) +CFLAGS += -DBAUD=115200 +CFLAGS += -DF_CPU=16000000UL +CFLAGS += -ffunction-sections -fdata-sections + +LDFLAGS = -mmcu=$(MCU) +LDFLAGS += -Wl,--gc-sections + +HEX_FLAGS = -O ihex +HEX_FLAGS += -j .text -j .data + +AVRDUDE_FLAGS = -p $(MCU) +AVRDUDE_FLAGS += -c arduino +AVRDUDE_FLAGS += -P /dev/cuaU0 +AVRDUDE_FLAGS += -D -U + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +elf: $(OBJ) + $(CC) $(LDFLAGS) $(OBJ) -o $(TARGET).elf + +hex: elf + avr-objcopy $(HEX_FLAGS) $(TARGET).elf $(TARGET).hex + +upload: hex + avrdude $(AVRDUDE_FLAGS) flash:w:$(TARGET).hex:i + +.PHONY: clean + +clean: + rm *.o *.elf *.hex + |
