From 0a35e7d7be87baedc193644342ef1636940fba1e Mon Sep 17 00:00:00 2001 From: Duncan Wilkie Date: Mon, 7 Aug 2023 17:31:16 -0500 Subject: Forgot to stage --- slaves/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 slaves/Makefile (limited to 'slaves/Makefile') diff --git a/slaves/Makefile b/slaves/Makefile new file mode 100644 index 0000000..cf4d5f3 --- /dev/null +++ b/slaves/Makefile @@ -0,0 +1,43 @@ + +PROJECT = slaves +MCU = ATTINY85 + + +AS = avr-as +LD = avr-ld +RM = rm -rf +MKDIR = @mkdir -p $(@D) + +# Custom/TI/build resource locations. +SRCS = $(wildcard src/*.s) \ + $(wildcard libs/*.s) +OBJ = obj/ +OBJS = $(addprefix $(OBJ),$(notdir $(SRCS:.s=.o))) +LD_SCRIPT = ld/$(MCU).ld + +# Flags. +AFLAGS = -mmcu=attiny85 --fatal-warnings # -ffunction-sections \ +# -ffreestanding -fdata-sections -std=c2x -Wall -Wextra -Werror -DPART_${MCU} -c - + +# Compiler/standard resource locations. +# More flags. +LDFLAGS = -T $(LD_SCRIPT) --gc-sections + + +# Targets. +all: bin/$(PROJECT).elf + +$(OBJ)%.o: src/%.s + $(MKDIR) + $(AS) -o $@ $^ $(AFLAGS) + +$(info $$PROJECT is [${PROJECT}]) +bin/$(PROJECT).elf: $(OBJS) + $(MKDIR) + $(LD) -o $@ $^ $(LDFLAGS) + +clean: + -$(RM) obj + -$(RM) bin + +.PHONY: all clean -- cgit v1.2.3