chore 📦: Update compiler settings and build rules
- This commit updates the compiler settings, object files, and build rules for the project.
This commit is contained in:
24
Makefile
24
Makefile
@@ -1,14 +1,24 @@
|
|||||||
CC = msp430-gcc
|
# Compiler settings
|
||||||
CFLAGS = -Wall -Os
|
CC = msp430-gcc # MSP430 compiler
|
||||||
LIBS = -lZStack -lhal
|
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
|
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
|
HEADERS = main.h zigbee_comm.h sensors/bme280.h sensors/wind_vane.h sensors/rain_gauge.h sensors/anemometer.h config.h
|
||||||
|
OBJS = $(SRCS:.c=.o) # create a list of object files from the source files
|
||||||
|
|
||||||
all: main
|
all: main.elf
|
||||||
|
|
||||||
main: $(SRCS) $(HEADERS)
|
main.elf: $(OBJS)
|
||||||
$(CC) $(CFLAGS) $(SRCS) $(LIBS) -o main.elf
|
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
||||||
|
|
||||||
|
%.o: %.c $(HEADERS)
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f main.elf
|
rm -f main.elf $(OBJS)
|
||||||
|
|
||||||
|
# Optionally add a rule to flash your device (if applicable)
|
||||||
|
# flash: $(EXEC)
|
||||||
|
# ./flash_tool $(EXEC) # This is just a placeholder if needed
|
||||||
Reference in New Issue
Block a user