Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 554ce08

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Unify BSD/OSX and GNU sed syntax to one
Belonging to [master]: - #2911
1 parent a27fbae commit 554ce08

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Compiler/boot/Makefile.common

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
ifeq ($(OS),Windows_NT)
2-
SED = sed
3-
else
4-
UNAME := $(shell uname)
5-
ifeq ($(UNAME),Darwin)
6-
SED = gsed
7-
else
8-
SED = sed
9-
endif
10-
endif
11-
121
ifeq ($(wildcard $(OMC)),)
132
all:
143
$(MAKE) -f $(defaultMakefileTarget) bootstrap-from-tarball
@@ -29,7 +18,7 @@ generate-files-in-steps:
2918

3019
GEN_DIR=build/
3120

32-
PATCH_SOURCES=$(SED) -i 's/ = omc_assert_function/__attribute__((noreturn)) = omc_assert_function/' build/_main.c
21+
PATCH_SOURCES=sed -i=.bak 's/ = omc_assert_function/__attribute__((noreturn)) = omc_assert_function/' build/_main.c
3322

3423
PATCHES := $(patsubst %.patch.xz,%.patch,$(wildcard patches/*.patch.xz))
3524

@@ -63,7 +52,7 @@ bootstrap-from-tarball:
6352
# Patch _main.c to avoid a new tarball
6453
$(MAKE) -f $(defaultMakefileTarget) patch-files
6554
$(PATCH_SOURCES)
66-
cd build && for x in ../patches/*.patch; do patch -i "$$x" "`basename $$x | $(SED) 's/\([.][0-9]*\)\?[.]patch//'`" || exit 1; done
55+
cd build && for x in ../patches/*.patch; do patch -i "$$x" "`basename $$x | sed 's/\([.][0-9]*\)\?[.]patch//'`" || exit 1; done
6756
# We have not compiled OpenModelicaScriptingAPI.mo yet
6857
touch build/OpenModelicaScriptingAPI.h
6958
$(MAKE) -f $(defaultMakefileTarget) install INCLUDESOURCES=1 OMC=.omc BOOTSTRAP_STAGE_1=1 CPPFLAGS="$(CPPFLAGS) -DOMC_BOOTSTRAPPING_STAGE_1"
@@ -101,7 +90,7 @@ make-bootstrap-tarball: clean
10190
test ! -f Makefile.depends || rm Makefile.depends
10291
OPENMODELICA_BACKEND_STUBS=1 $(MAKE) -f $(defaultMakefileTarget) generate-files-in-steps
10392
rm -rf $(GEN_DIR)/*.mo $(GEN_DIR)/tmp $(GEN_DIR)/*.deps $(GEN_DIR)/*.mos $(GEN_DIR)/*.stamp
104-
sed -i -e "s/^ *//" -e "/^[/][/]/d" -e "/^#line /d" -e "s/ *[/][*].*[*][/]\([;)]\?\) *$$/\1/" -e "s/^ *[/][*].*[*][/]\(;\?\) */\1/" -e "/^ *$$/d" $(GEN_DIR)/*.c $(GEN_DIR)/*.h
93+
sed -i.bak -e "s/^ *//" -e "/^[/][/]/d" -e "/^#line /d" -e "s/ *[/][*].*[*][/]\([;)]\?\) *$$/\1/" -e "s/^ *[/][*].*[*][/]\(;\?\) */\1/" -e "/^ *$$/d" $(GEN_DIR)/*.c $(GEN_DIR)/*.h
10594
tar cf bootstrap-sources.tar $(GEN_DIR) Makefile.sources
10695
xz --best --force bootstrap-sources.tar
10796

0 commit comments

Comments
 (0)