Skip to content

Commit

Permalink
makefile: let replace_float compatible with macOS builtin BSD sed (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryzj authored Jul 16, 2024
1 parent 90e9650 commit 0968390
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rvv-intrinsic-generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ __check_defined = \
$(error Undefined $1$(if $2, ($2))))

# Replace softfloat float-point types with LLVM compatible floating-point types
# macOS uses BSD sed
ifeq ($(shell uname), Darwin)
SED_CMD = sed -i ''
else
SED_CMD = sed -i
endif

replace_float = \
sed -i 's/float16_t/_Float16/g' $(1)/*; \
sed -i 's/float32_t/float/g' $(1)/*; \
sed -i 's/float64_t/double/g' $(1)/*
$(SED_CMD) 's/float16_t/_Float16/g' $(1)/*; \
$(SED_CMD) 's/float32_t/float/g' $(1)/*; \
$(SED_CMD) 's/float64_t/double/g' $(1)/*

###############################################################################
# Variables
Expand Down

0 comments on commit 0968390

Please sign in to comment.