https://cgit.freebsd.org/ports/tree/devel/wasi-libc/Makefile#n40
avoid rebuilding everything in fake

wasi-libc requires some compiler headers that we remove from our
llvm ports so we include them here instead

chunk 2: adapt regex for our grep
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -466,7 +466,7 @@ endif
 #    should come earlier in the search path, so they can "override"
 #    and/or `#include_next` the public headers. `-isystem` (like
 #    `-idirafter`) comes later in the search path than `-I`.
-CFLAGS += -isystem "$(SYSROOT_INC)"
+CFLAGS += -isystem "$(SYSROOT_INC)" -isystem "${WRKDIR}/sysroot/include"
 
 # These variables describe the locations of various files and directories in
 # the build tree.
@@ -814,7 +814,7 @@ finish: check-symbols
 endif
 endif
 
-install: finish
+install:
 	mkdir -p "$(INSTALL_DIR)"
 	cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"
 
@@ -929,14 +929,15 @@ check-symbols: $(STARTUP_FILES) libc
 	    -U__FLT_EVAL_METHOD__ -Wno-builtin-macro-redefined \
 	    | sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \
 	    | sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
-	    | grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
-	    | grep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_\(1\|2\|4\|8\)' \
+	    | egrep -v '^#define __(BOOL|INT_(LEAST|FAST)(8|16|32|64)|INT|LONG|LLONG|SHRT)_WIDTH__' \
+	    | egrep -v '^#define __MEMORY_SCOPE_(DEVICE|SINGLE|SYSTEM|WRKGRP|WVFRNT)' \
+	    | egrep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_(1|2|4|8)' \
 	    | grep -v '^#define __FPCLASS_' \
 	    | grep -v '^#define __FLT128_' \
 	    | grep -v '^#define __MEMORY_SCOPE_' \
-	    | grep -v '^#define __GCC_\(CON\|DE\)STRUCTIVE_SIZE' \
+	    | egrep -v '^#define __GCC_(CON|DE)STRUCTIVE_SIZE' \
 	    | grep -v '^#define __STDC_EMBED_' \
-	    | grep -v '^#define __\(DBL\|FLT\|LDBL\)_NORM_MAX__' \
+	    | egrep -v '^#define __(DBL|FLT|LDBL)_NORM_MAX__' \
 	    | grep -v '^#define NDEBUG' \
 	    | grep -v '^#define __OPTIMIZE__' \
 	    | grep -v '^#define assert' \
