summaryrefslogtreecommitdiff
path: root/configs/gcc.tup
diff options
context:
space:
mode:
Diffstat (limited to 'configs/gcc.tup')
-rw-r--r--configs/gcc.tup40
1 files changed, 40 insertions, 0 deletions
diff --git a/configs/gcc.tup b/configs/gcc.tup
new file mode 100644
index 0000000..ad2d788
--- /dev/null
+++ b/configs/gcc.tup
@@ -0,0 +1,40 @@
+CC = $(TOOLCHAIN)-gcc
+LD = $(TOOLCHAIN)-gcc
+AR = $(TOOLCHAIN)-ar
+AS = $(TOOLCHAIN)-as
+OBJCOPY = $(TOOLCHAIN)-objcopy
+OBJDUMP = $(TOOLCHAIN)-objdump
+SIZE = $(TOOLCHAIN)-size
+GDB = $(TOOLCHAIN)-gdb
+
+
+CFLAGS += -g -Os
+CFLAGS += -std=gnu99
+CFLAGS += -Wall -Wextra
+CFLAGS += -Wredundant-decls
+#CFLAGS += -fno-common -ffunction-sections -fdata-sections
+
+
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += -Wl,--cref
+
+ifneq ($(LDSCRIPT),)
+LDFLAGS += -T$(LDSCRIPT)
+endif
+
+
+!cc = |> ^ CC %f^ $(CC) $(CFLAGS) $(CPPFLAGS) -c %f -o %o |> %B.o
+!LINK = |> ^ LINK %o^ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-Map=%O.map %f $(LDLIBS) -o %o |> | %O.map
+!OBJCOPY= |> ^ OBJCOPY %o^ $(OBJCOPY) -Oihex %f %o |>
+!OBJDUMP= |> ^ OBJDUMP %o^ $(OBJDUMP) -h -S %f > %o |> %O.lss
+!SIZE = |> ^ SIZE %f^ $(SIZE) %f |>
+
+
+: foreach $(SRC) | $(PREDEP) |> !cc |> {objs}
+: $(SRC_Z) |> !cc $(CPPFLAGS_Z) |> {objs}
+
+: {objs} |> !LINK |> $(PROG).elf {elf}
+: {elf} |> !OBJCOPY |> %B.hex {aux}
+: {elf} |> !OBJDUMP |> %B.lss {aux}
+: {elf} | {aux} |> !SIZE |>
+