summaryrefslogtreecommitdiff
path: root/slaves/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'slaves/Makefile')
-rw-r--r--slaves/Makefile43
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