diff options
Diffstat (limited to 'configs')
-rw-r--r-- | configs/debug.config | 1 | ||||
-rw-r--r-- | configs/default.config | 0 | ||||
-rw-r--r-- | configs/gcc.tup | 40 |
3 files changed, 41 insertions, 0 deletions
diff --git a/configs/debug.config b/configs/debug.config new file mode 100644 index 0000000..1a54f76 --- /dev/null +++ b/configs/debug.config @@ -0,0 +1 @@ +CONFIG_DEBUG=0 diff --git a/configs/default.config b/configs/default.config new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/configs/default.config 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 |> + |