diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-08-22 10:35:26 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-08-22 10:35:26 -0400 |
commit | 69fc1e63b4c240a2e8d36736b551140db8acc08b (patch) | |
tree | 884bf739368f4881440ab57add3a4e1b213f7d0a | |
parent | 1022729a2adbeeb985848e82bb07f7af4d079c06 (diff) | |
download | kutter-69fc1e63b4c240a2e8d36736b551140db8acc08b.tar.gz kutter-69fc1e63b4c240a2e8d36736b551140db8acc08b.tar.xz kutter-69fc1e63b4c240a2e8d36736b551140db8acc08b.zip |
Makefile: Translate null characters to newline characters in ctr requests
Store the CTR requests in compile_time_request.txt with the null
characters removed. This makes it slightly easier to inspect the CTR
conversions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | scripts/buildcommands.py | 2 | ||||
-rw-r--r-- | src/ctr.h | 4 |
3 files changed, 5 insertions, 5 deletions
@@ -87,8 +87,8 @@ $(OUT)%.o.ctr: $(OUT)%.o $(OUT)compile_time_request.o: $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) ./scripts/buildcommands.py @echo " Building $@" - $(Q)cat $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) > $(OUT)klipper.compile_time_request - $(Q)$(PYTHON) ./scripts/buildcommands.py -d $(OUT)klipper.dict -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)klipper.compile_time_request $(OUT)compile_time_request.c + $(Q)cat $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) | tr '\0' '\n' > $(OUT)compile_time_request.txt + $(Q)$(PYTHON) ./scripts/buildcommands.py -d $(OUT)klipper.dict -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)compile_time_request.txt $(OUT)compile_time_request.c $(Q)$(CC) $(CFLAGS) -c $(OUT)compile_time_request.c -o $@ $(OUT)klipper.elf: $(OBJS_klipper.elf) diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index 6ef5c80a..b74581de 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -603,7 +603,7 @@ def main(): f = open(incmdfile, 'rb') data = f.read() f.close() - for req in data.split('\0'): + for req in data.split('\n'): req = req.lstrip() if not req: continue @@ -2,8 +2,8 @@ #define __CTR_H // Definitions for creating compile time requests. The DECL_CTR macro // produces requests (text strings) that are placed in a special -// section of the intermediate object files. The requests are then -// extracted during the build and passed to scripts/buildcommand.py. +// section of the intermediate object files (*.o). The build extracts +// these strings and places them in out/compile_time_requests.txt. // The scripts/buildcommand.py code then generates // out/compile_time_request.c from these requests. |