Merge pull request #215 from ska80/fix-bsd-sed

Make BSD 'sed' happy
This commit is contained in:
Edwin Brady 2020-03-07 14:06:38 +00:00 committed by GitHub
commit 28f47963df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,20 @@ export CC=clang # clang compiles the output much faster than gcc!
################################################################## ##################################################################
MACHINE := $(shell $(CC) -dumpmachine)
ifneq (, $(findstring darwin, $(MACHINE)))
OS := darwin
else ifneq (, $(findstring cygwin, $(MACHINE)))
OS := windows
else ifneq (, $(findstring mingw, $(MACHINE)))
OS := windows
else ifneq (, $(findstring windows, $(MACHINE)))
OS := windows
else
OS := unix
endif
# current Idris2 version components # current Idris2 version components
MAJOR=0 MAJOR=0
MINOR=0 MINOR=0
@ -54,7 +68,11 @@ idris2: dist/idris2.c idris2-fromc
# (Also replaces the first line of the generated C with the proper prefix) # (Also replaces the first line of the generated C with the proper prefix)
# #
idris2-fromc: idris2-fromc:
sed -i '1 s|^.*$$|char* idris2_prefix = "${PREFIX}";|' dist/idris2.c ifeq ($(OS), darwin)
@sed -i '' '1 s|^.*$$|char* idris2_prefix = "${PREFIX}";|' dist/idris2.c
else
@sed -i '1 s|^.*$$|char* idris2_prefix = "${PREFIX}";|' dist/idris2.c
endif
make -C dist make -C dist
@cp dist/idris2 ./idris2 @cp dist/idris2 ./idris2