aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-05-26 09:14:26 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-05-26 12:39:34 -0400
commita82e949c00aceaedd9d9a76ddcc3c88c9cad3d80 (patch)
tree685af9ff540b0407cfb0f96664fc3dccbc160152 /Makefile
parentca9756413f2793279b5ba1c1ecf274ce734b2087 (diff)
downloadkutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.tar.gz
kutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.tar.xz
kutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.zip
build: Use compile_time_request system for init, tasks, and shutdown
Avoid using linker magic to define the init, task, and shutdown functions. Instead, use the compile_time_request system. This simplifies the build and produces more efficient code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 1 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 39535898..8e1965a0 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,6 @@ CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -O2 -MD -g \
-ffunction-sections -fdata-sections
CFLAGS += -flto -fwhole-program -fno-use-linker-plugin
-CFLAGS_klipper.o = $(CFLAGS) -Wl,-r -nostdlib
CFLAGS_klipper.elf = $(CFLAGS) -Wl,--gc-sections
CPPFLAGS = -I$(OUT) -P -MD -MT $@
@@ -84,15 +83,7 @@ $(OUT)compile_time_request.o: $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) ./scri
$(Q)$(PYTHON) ./scripts/buildcommands.py -d $(OUT)klipper.dict $(OUT)klipper.compile_time_request $(OUT)compile_time_request.c
$(Q)$(CC) $(CFLAGS) -c $(OUT)compile_time_request.c -o $@
-$(OUT)declfunc.lds: src/declfunc.lds.S
- @echo " Precompiling $@"
- $(Q)$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $@
-
-$(OUT)klipper.o: $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)compile_time_request.o $(OUT)declfunc.lds
- @echo " Linking $@"
- $(Q)$(CC) $(CFLAGS_klipper.o) -Wl,-T,$(OUT)declfunc.lds $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)compile_time_request.o -o $@
-
-$(OUT)klipper.elf: $(OUT)klipper.o
+$(OUT)klipper.elf: $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)compile_time_request.o
@echo " Linking $@"
$(Q)$(CC) $(CFLAGS_klipper.elf) $^ -o $@