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-
121ifeq ($(wildcard $(OMC)),)
132all:
143 $(MAKE) -f $(defaultMakefileTarget) bootstrap-from-tarball
@@ -29,7 +18,7 @@ generate-files-in-steps:
2918
3019GEN_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
3423PATCHES := $(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