From f7121a2a5b72b90b43270531f2f78a291184787d Mon Sep 17 00:00:00 2001 From: Scott Beamer Date: Wed, 14 Sep 2016 11:34:23 -0700 Subject: [PATCH] support for BSD sed (GNU sed still works) --- Makefrag | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefrag b/Makefrag index a8335606..e05f6d69 100644 --- a/Makefrag +++ b/Makefrag @@ -49,12 +49,13 @@ bootrom_img = $(base_dir)/bootrom/bootrom.img # Constants Header Files #--------------------------------------------------------------------- +# sed uses -E (instead of -r) for BSD support params_file = $(generated_dir)/$(MODEL).$(CONFIG).prm consts_header = $(generated_dir)/consts.$(CONFIG).h $(consts_header): $(params_file) echo "#ifndef __CONST_H__" > $@ echo "#define __CONST_H__" >> $@ - sed -r 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@ + sed -E 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@ echo "#endif // __CONST_H__" >> $@ params_file_debug = $(generated_dir_debug)/$(MODEL).$(CONFIG).prm @@ -62,7 +63,7 @@ consts_header_debug = $(generated_dir_debug)/consts.$(CONFIG).h $(consts_header_debug): $(params_file_debug) echo "#ifndef __CONST_H__" > $@ echo "#define __CONST_H__" >> $@ - sed -r 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@ + sed -E 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@ echo "#endif // __CONST_H__" >> $@ clean-run-output: