make sed commands compatible with gnu sed

This commit is contained in:
Sebastian Hugentobler 2015-12-01 10:02:25 +01:00
parent 1115a3fc34
commit 1fe4c53999

View File

@ -12,7 +12,7 @@ PSBOOK = psbook
PSTOPS = pstops
PSNUP = psnup
PS2PDF = ps2pdf
SED = sed
SED = sed # do not use in-place editing for compatibility between different sed utilities
RM = rm
MKDIR = mkdir
CD = cd
@ -55,8 +55,8 @@ $(BOOKPDF): | $(PDFDIR) $(OUTDIR)
@$(CP) -r lib/* $(OUTDIR)/
@$(CP) -r $(SRCDIR)/images $(OUTDIR)/images
@$(SED) "s;\musicbooklet;$(LILYPONDSUBST);g" $(SRCDIR)/singalongs.tex > $(OUTPUTFILE)
@$(SED) -i '' 's;\input{revision.tex};\newcommand{\\revision}{ $(shell git log -1 --format="%h") };g' $(OUTPUTFILE)
@$(SED) "s;\musicbooklet;$(LILYPONDSUBST);g" $(SRCDIR)/singalongs.tex > $(OUTPUTFILE).00
@$(SED) 's;\input{revision.tex};\newcommand{\\revision}{ $(shell git log -1 --format="%h") };g' $(OUTPUTFILE).00 > $(OUTPUTFILE)
@$(CD) $(OUTDIR); \
$(LUALATEX) -shell-escape singalongs.tex; \
@ -69,14 +69,14 @@ $(BOOKLETPDF): $(BOOKPDF)
$(PDF2PS) $(BOOKPDF) - | $(PSBOOK) | $(PSTOPS) -pa4 '1:0@1.0(-1.25cm,0cm)' | $(PSNUP) -2 | $(PS2PDF) - $(PDFDIR)/$(@F)
$(PDFDIR)/%.pdf: $(SCORESDIR)/%.ly | $(PDFDIR) $(OUTDIR)
@$(SED) 's/%title/title/g' $< > $(OUTDIR)/$(notdir $<)
@$(SED) -i '' 's/\header {/\paper{indent=0\\mm} \\header { tagline=""/g' $(OUTDIR)/$(notdir $<)
@$(SED) 's/%title/title/g' $< > $(OUTDIR)/$(notdir $<).00
@$(SED) 's/\header {/\paper{indent=0\\mm} \\header { tagline=""/g' $(OUTDIR)/$(notdir $<).00 > $(OUTDIR)/$(notdir $<)
@$(LILYPOND) --output=$(PDFDIR)/$(basename $(@F)) $(OUTDIR)/$(notdir $<)
$(MIDIDIR)/%.midi: $(SCORESDIR)/%.ly | $(MIDIDIR) $(OUTDIR)
@$(SED) 's/\layout { }/\midi{ \\tempo 4 = $(MIDITEMPO) }/g' $< > $(OUTDIR)/$(notdir $<)
@$(SED) -i '' 's/\header/\include "articulate.ly" \\header/g' $(OUTDIR)/$(notdir $<)
@$(SED) -i '' 's/<</\\articulate \\unfoldRepeats <</g' $(OUTDIR)/$(notdir $<)
@$(SED) 's/\layout { }/\midi{ \\tempo 4 = $(MIDITEMPO) }/g' $< > $(OUTDIR)/$(notdir $<).00
@$(SED) 's/\header/\include "articulate.ly" \\header/g' $(OUTDIR)/$(notdir $<).00 > $(OUTDIR)/$(notdir $<).01
@$(SED) 's/<</\\articulate \\unfoldRepeats <</g' $(OUTDIR)/$(notdir $<).01 > $(OUTDIR)/$(notdir $<)
@$(LILYPOND) --output=$(MIDIDIR)/$(basename $(@F)) $(OUTDIR)/$(notdir $<)
$(OPUSDIR)/%.opus: $(MIDIDIR)/%.midi | $(OPUSDIR)