From a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 26 May 2017 09:14:26 -0400 Subject: 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 --- Makefile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'Makefile') 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 $@ -- cgit v1.2.3-70-g09d2