Skip to content

Commit ecf4b9e

Browse files
authored
Improve substitution rules for SYMBOLPREFIX and -SUFFIX addition
1 parent da9e2a7 commit ecf4b9e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Makefile.install

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ ifndef NO_CBLAS
4747
@echo Generating cblas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
4848
@cp cblas.h cblas.tmp
4949
ifdef SYMBOLPREFIX
50-
@sed 's/cblas/$(SYMBOLPREFIX)cblas/g' cblas.tmp > cblas.tmp2
51-
@sed 's/openblas/$(SYMBOLPREFIX)openblas/g' cblas.tmp2 > cblas.tmp
50+
@sed 's/cblas[^( ]*/$(SYMBOLPREFIX)&/g' cblas.tmp > cblas.tmp2
51+
@sed 's/openblas[^( ]*/$(SYMBOLPREFIX)&/g' cblas.tmp2 > cblas.tmp
52+
#change back any openblas_complex_float and double that got hit
53+
@sed 's/$(SYMBOLPREFIX)openblas_complex_/openblas_complex_/g' cblas.tmp > cblas.tmp2
54+
@sed 's/goto[^( ]*/$(SYMBOLPREFIX)&/g' cblas.tmp2 > cblas.tmp
5255
endif
5356
ifdef SYMBOLSUFFIX
54-
@sed 's/(OPENBLAS/$(SYMBOLSUFFIX)(OPENBLAS/g' cblas.tmp > cblas.tmp2
55-
@sed 's/(void)/$(SYMBOLSUFFIX)(void)/g' cblas.tmp2 > cblas.tmp
57+
@sed 's/cblas[^( ]*/&$(SYMBOLSUFFIX)/g' cblas.tmp > cblas.tmp2
58+
@sed 's/openblas[^( ]*/&$(SYMBOLSUFFIX)/g' cblas.tmp2 > cblas.tmp
59+
#change back any openblas_complex_float and double that got hit
60+
@sed 's/\(openblas_complex_\)\([^ ]*\)$(SYMBOLSUFFIX)/\1\2 /g' cblas.tmp > cblas.tmp2
61+
@sed 's/goto[^( ]*/&$(SYMBOLSUFFIX)/g' cblas.tmp2 > cblas.tmp
5662
endif
5763
@sed 's/common/openblas_config/g' cblas.tmp > "$(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h"
5864
endif

0 commit comments

Comments
 (0)