Files
zigbee_weather_station/Makefile
T

24 lines
830 B
Makefile
Raw Normal View History

2025-02-22 11:15:35 +01:00
# Compiler settings
2025-02-22 12:43:51 +01:00
CC = msp430-elf-gcc # MSP430 compiler
2025-02-22 11:15:35 +01:00
CFLAGS = -Wall -Os # Enable all warnings, Optimize for size
LDFLAGS =
LIBS = -lZStack -lhal # ZStack for Zigbee communication, lhal for Hardware Abstraction Layer library
SRCS = main.c zigbee_comm.c sensors/bme280.c sensors/wind_vane.c sensors/rain_gauge.c sensors/anemometer.c
HEADERS = main.h zigbee_comm.h sensors/bme280.h sensors/wind_vane.h sensors/rain_gauge.h sensors/anemometer.h config.h
2025-02-22 11:15:35 +01:00
OBJS = $(SRCS:.c=.o) # create a list of object files from the source files
2025-02-22 11:15:35 +01:00
all: main.elf
2025-02-22 11:15:35 +01:00
main.elf: $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
2025-02-22 11:15:35 +01:00
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f main.elf $(OBJS)
2025-02-22 11:15:35 +01:00
# Optionally add a rule to flash your device (if applicable)
# flash: main.elf
# ./flash_tool main.elf # This is just a placeholder if needed