Skip to content

Commit 266c9e5

Browse files
committed
260228.120155.CST [skip ci] update regarding uname and SEDI
1 parent 9327ede commit 266c9e5

4 files changed

Lines changed: 26 additions & 54 deletions

File tree

.github/scripts

fortran/tests/makefiles/Makefile.common

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,18 @@ else
302302
GDB := bash $(TOOLS_DIR)/run_gdb
303303
endif
304304

305-
# Define SEDI.
306-
# When calling "sed -i" on macOS, it is obligatory to specify a string (e.g., .bak) after -i as the
307-
# extension for saving a backup. If the string is "", then no backup will be saved. If no string is
308-
# specified, then an error will be raised, saying "invalid command code".
309-
SEDI :=
310-
ifeq ($(OSTYPE), MAC)
311-
SEDI := sed -i ""
312-
else
313-
SEDI := sed -i
314-
endif
305+
## Define SEDI.
306+
## When calling "sed -i" on macOS and FreeBSD, it is obligatory to specify a string (e.g., .bak)
307+
## after -i as the extension for saving a backup. If the string is "", then no backup will be saved.
308+
## If no string is specified, then an error will be raised, saying "invalid command code".
309+
#SEDI :=
310+
#ifeq ($(OSTYPE), MAC)
311+
# SEDI := sed -i ""
312+
#else ifeq ($(OSTYPE), FREEBSD)
313+
# SEDI := sed -i ""
314+
#else
315+
# SEDI := sed -i
316+
#endif
315317

316318
# Define NPROCS to be the number of processors available to make tests in parallel.
317319
NPROCS :=
@@ -1110,22 +1112,6 @@ source_%: $(SRC_DIRS)
11101112
fi
11111113
@printf "Done.\n"
11121114

1113-
# Adapt the header file for the test.
1114-
# Zaikun 20230411: Instead of modifying the header file, we should use the -D option of the
1115-
# preprocessors (cpp or fpp). See the definition of $(EXTRA_FLAGS) for details.
1116-
#header_%: IK = $(shell expr 8 \* $$(echo $@ | sed "s/.*_i//" | sed "s/_.*//"))
1117-
#header_%: RP = $(shell expr 8 \* $$(echo $@ | sed "s/.*_r//" | sed "s/_.*//"))
1118-
#header_%: DBG = $(shell echo $@ | sed "s/.*_d//" | sed "s/_.*//")
1119-
#header_%: QPAVLB = $(shell expr $$(echo $@ | sed "s/.*_r//" | sed "s/_.*//") / 16)
1120-
#header_%: source_%
1121-
# @printf "\nPreparing the header file for the test.\n"
1122-
# $(SEDI) "s|^#define PRIMA_QP_AVAILABLE [0-9]*|#define PRIMA_QP_AVAILABLE $(QPAVLB)|" $(HEADERS)
1123-
# $(SEDI) "s|^#define PRIMA_INTEGER_KIND [0-9]*|#define PRIMA_INTEGER_KIND $(IK)|" $(HEADERS)
1124-
# $(SEDI) "s|^#define PRIMA_REAL_PRECISION [0-9]*|#define PRIMA_REAL_PRECISION $(RP)|" $(HEADERS)
1125-
# $(SEDI) "s|^#define PRIMA_DEBUGGING [0-9]*|#define PRIMA_DEBUGGING $(DBG)|" $(HEADERS)
1126-
# $(SEDI) "s|^#define PRIMA_AGGRESSIVE_OPTIONS [0-9]*|#define PRIMA_AGGRESSIVE_OPTIONS $(AGGRESSIVE)|" $(HEADERS)
1127-
# @printf "Done.\n"
1128-
11291115

11301116
####################################################################################################
11311117
# Cleaning up.

fortran/tests/tools/gsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if ! basename "$DIR" | grep -q ".test\|test." || ! [[ -d "$DIR" ]] ; then
1010
exit 1
1111
fi
1212

13-
if [[ "$(uname)" == "Darwin" ]]; then
13+
if [[ "$(uname)" == Darwin || "$(uname)" == FreeBSD ]] ; then
1414
SEDI='sed -i ""'
1515
else
1616
SEDI='sed -i'

matlab/mex_gateways/tests/makefiles/Makefile.common

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,18 @@ else
171171
endif
172172
endif
173173

174-
# Define SEDI.
175-
# When calling "sed -i" on macOS, it is obligatory to specify a string (e.g., .bak) after -i as the
176-
# extension for saving a backup. If the string is "", then no backup will be saved. If no string is
177-
# specified, then an error will be raised, saying "invalid command code".
178-
SEDI :=
179-
ifeq ($(OSTYPE), MAC)
180-
SEDI = @sed -i ""
181-
else
182-
SEDI = @sed -i
183-
endif
174+
## Define SEDI.
175+
## When calling "sed -i" on macOS and FreeBSD, it is obligatory to specify a string (e.g., .bak)
176+
## after -i as the extension for saving a backup. If the string is "", then no backup will be saved.
177+
## If no string is specified, then an error will be raised, saying "invalid command code".
178+
#SEDI :=
179+
#ifeq ($(OSTYPE), MAC)
180+
# SEDI := sed -i ""
181+
#else ifeq ($(OSTYPE), FREEBSD)
182+
# SEDI := sed -i ""
183+
#else
184+
# SEDI := sed -i
185+
#endif
184186

185187
## Define NPROCS to be the number of processors available to make tests in parallel.
186188
#NPROCS :=
@@ -609,22 +611,6 @@ source_%: $(SRC_DIRS)
609611
fi
610612
@printf "Done.\n"
611613

612-
# Adapt the header file for the test.
613-
# Zaikun 20230411: Instead of modifying the header file, we should use the -D option of the
614-
# preprocessors (cpp or fpp). See the definition of $(EXTRA_FLAGS) for details.
615-
#header_%: IK = $(shell expr 8 \* $$(echo $@ | sed "s/.*_i//" | sed "s/_.*//"))
616-
#header_%: RP = $(shell expr 8 \* $$(echo $@ | sed "s/.*_r//" | sed "s/_.*//"))
617-
#header_%: DBG = $(shell echo $@ | sed "s/.*_d//" | sed "s/_.*//")
618-
#header_%: QPAVLB = $(shell expr $$(echo $@ | sed "s/.*_r//" | sed "s/_.*//") / 16)
619-
#header_%: source_%
620-
# @if [[ -z "$(FINTRFH)" ]] ; then printf "\nfintrf.h is not available. Skip the test.\n"; exit 0; fi
621-
# @printf "\nPreparing the header file for the test.\n"
622-
# $(SEDI) "0,/^#define PRIMA_QP_AVAILABLE [0-9]*/s//#define PRIMA_QP_AVAILABLE $(QPAVLB)/" $(HEADERS)
623-
# $(SEDI) "0,/^#define PRIMA_INTEGER_KIND [0-9]*/s//#define PRIMA_INTEGER_KIND $(IK)/" $(HEADERS)
624-
# $(SEDI) "0,/^#define PRIMA_REAL_PRECISION [0-9]*/s//#define PRIMA_REAL_PRECISION $(RP)/" $(HEADERS)
625-
# $(SEDI) "0,/^#define PRIMA_DEBUGGING [0-9]*/s//#define PRIMA_DEBUGGING $(DBG)/" $(HEADERS)
626-
# @printf "Done.\n"
627-
628614

629615
####################################################################################################
630616
# Cleaning up.

0 commit comments

Comments
 (0)