diff options
author | Duncan Wilkie <antigravityd@gmail.com> | 2023-08-07 17:31:16 -0500 |
---|---|---|
committer | Duncan Wilkie <antigravityd@gmail.com> | 2023-08-07 17:31:16 -0500 |
commit | 0a35e7d7be87baedc193644342ef1636940fba1e (patch) | |
tree | ce322bdc53fd9e21013fc9cda35f98475035c94e /slaves/Makefile | |
parent | 2a3940d8a36433485a6ef489d5123cd491618b50 (diff) |
Forgot to stage
Diffstat (limited to 'slaves/Makefile')
-rw-r--r-- | slaves/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
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 |