]> wirehaze git hosting - stm32f411ceu6.git/commitdiff

wirehaze git hosting

initial commit main
authorphfr24 <phfr24@inf.ufpr.br>
Sun, 15 Mar 2026 19:06:24 +0000 (16:06 -0300)
committerphfr24 <phfr24@inf.ufpr.br>
Sun, 15 Mar 2026 19:06:24 +0000 (16:06 -0300)
add Makefile, notes.txt

Makefile [new file with mode: 0644]
notes.txt [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..df8f758
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,73 @@
+# GNU 'make'
+#
+# 10.2 Catalogue of Built-In Rules
+# ================================
+#
+# Compiling C programs
+#      'N.o' is made automatically from 'N.c' with a recipe of the form
+#      '$(CC) $(CPPFLAGS) $(CFLAGS) -c'.
+#
+# Assembling and preprocessing assembler programs
+#      'N.o' is made automatically from 'N.s' by running the assembler,
+#      'as'.  The precise recipe is '$(AS) $(ASFLAGS)'.
+#
+#      'N.s' is made automatically from 'N.S' by running the C
+#      preprocessor, 'cpp'.  The precise recipe is '$(CPP) $(CPPFLAGS)'.
+
+# Preprocessor
+CPP := arm-none-eabi-cpp
+CPPFLAGS :=
+
+# Assembler
+AS := arm-none-eabi-as
+ASFLAGS :=
+
+# C Compiler
+CC := arm-none-eabi-gcc
+CFLAGS := -march=armv7e-m+fp \
+                                       -mtune=cortex-m4 \
+                                       -mthumb \
+                                       -mfloat-abi=hard \
+                                       -std=gnu90 \
+                                       -ffreestanding \
+                                       -fsingle-precision-constant \
+                                       -pedantic \
+                                       -pedantic-errors \
+                                       -Wall \
+                                       -Wextra \
+                                       -Wconversion \
+                                       -Wstrict-prototypes \
+                                       -Wshadow \
+                                       -Wundef \
+                                       -Wdouble-promotion
+
+# Linker
+LD := arm-none-eabi-ld
+LDFLAGS := -nostdlib
+LDLIBS :=
+
+# objcopy
+OC := arm-none-eabi-objcopy
+OCFLAGS := --output-target=binary
+
+# Build
+objs := kernel.o
+lds := kernel.ld
+LDFLAGS += -T $(lds)
+
+elf := kernel.elf
+bin := kernel.bin
+
+# Targets
+all : $(bin)
+
+clean :
+       rm -f $(bin) $(elf) $(objs)
+
+.PHONY : all clean
+
+$(bin) : $(elf)
+       $(OC) $(OCFLAGS) $< $@
+
+$(elf) : $(objs) $(lds)
+       $(LD) $(filter %.o,$^) $(LDFLAGS) $(LDLIBS) -o $@
diff --git a/notes.txt b/notes.txt
new file mode 100644 (file)
index 0000000..d9140c0
--- /dev/null
+++ b/notes.txt
@@ -0,0 +1,3 @@
+[ ] linker script
+[ ] test -Os / -Oz optimization flags
+[ ] deep dive into GNU toolkit documentation