Files
zigbee_weather_station/Makefile
Jose 51601be546 feat : Add GitHub Actions workflow for SDCC build and test on CC2530
- This commit adds a new GitHub Actions workflow for building and testing SDCC (Software Development Compiler) on CC2530.
- The changes are to update the build process for Zigbee sensor firmware, switching from MSP430 compiler to sdcc and updating object file generation rules.
- This commit updates the build system for the project, adding and configuring new paths, compiler settings, and dependencies for the Z-Stack SDK.
2025-02-23 10:12:09 +01:00

35 lines
1004 B
Makefile

# Path to Z-Stack SDK
ZSTACK_DIR = ./include
# Include path for the Z-Stack SDK
# INCLUDE_DIRS = -I$(ZSTACK_DIR)/Components/hal/CC2530 \
# -I$(ZSTACK_DIR)/Components/zigbee
INCLUDE_DIRS = -I$(ZSTACK_DIR)
# Compiler settings
CC = sdcc # sdcc compiler
CFLAGS = -mmc51 $(INCLUDE_DIRS) # add include paths to compiler flags
SRC=$(wildcard *.c)
HEADERS = main.h zigbee_comm.h sensors/bme280.h sensors/wind_vane.h sensors/rain_gauge.h sensors/anemometer.h config.h include/hal_types.h include/hal_defs.h include/hal_timer.h include/ZComDef.h include/OSAL.h include/i2c.h
# Object files (replace .c with .o)
OBJS = $(SRCS:.c=.o)
# Output file
OUTPUT=output.ihx
# Default target: compile and generate the hex file
all: $(OUTPUT)
# Rule to build the output file
$(OUTPUT): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(OUTPUT)
# Rule to build object files from source files
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
# Clean generated files
clean:
rm -f $(OUTPUT) $(OBJS) *.asm *.lst *.sym