From 998240d5f5904e20760a987dc29aefc6fe00bcfb Mon Sep 17 00:00:00 2001 From: nhkeni Date: Sun, 10 Mar 2024 18:35:19 -0400 Subject: [PATCH] remove gmake-specific code from Makefile.src The awk script for NOSTATICCORE is currently broken. --- sys/unix/Makefile.src | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 640b961a3..a58257a60 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -447,23 +447,27 @@ QUIETCC=0 # NB: This is not used for all .c files (see explicit rules in # dependencies). -ifndef NOSTATICCORE - # A normal or cross compile. +# if NOSTATICCORE +# A normal or cross compile. +# else +# NOSTATICCORE: A compile that makes all functions non-static. +# Rule /=/ allows 2 definitions of char array brief_feeling +# fi $(TARGETPFX)%.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ $< -else - # NOSTATICCORE: A compile that makes all functions non-static. - # Rule /=/ allows 2 definitions of char array brief_feeling -$(TARGETPFX)%.o : %.c - awk ' \ - BEGIN{print "#line 1 \"$<\""} \ - /=/{print;next} \ - sub(/^static inline/, "") \ - sub(/^static( |$$)/, "") \ - ' < $< > .$< - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ .$< -endif - + if [ x$(NOSTATICCORE) = 'x' ]; then \ + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ $< ; \ + else \ + ( \ + $(AWK) ' \ + BEGIN{print "#line 1 \"$<\""}; \ + /=/{print;next}; \ + sub(/^static inline/, ""){print;next}; \ + sub(/^static( |$$)/, ""){print;next}; \ + {print}; \ + ' < $< > .$< && \ + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ .$< ; \ + ) \ + fi # Verbosity definitions, begin # Set QUIETCC=1 above to output less feedback while building.