From 5a8e64a5950b7de32f65b69da7950a12f7af2c79 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Wed, 15 Dec 2021 02:31:18 +0100 Subject: [PATCH] Makefile: fix shell quoting --- Makefile | 14 +++++++------- doc/Makefile | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index c0d6762..ae9c746 100644 --- a/Makefile +++ b/Makefile @@ -102,11 +102,11 @@ install: $(BINARIES) $(LIBRARIES) $(SHAREDIR)/gray.1 # GRAY binary $(GRAY): $(shell ./depend $(OBJDIR)/main.o) | $(BINDIR) - $(LD) $(LDFLAGS) -o $@ $^ + $(LD) $(LDFLAGS) -o '$@' $^ # GRAY shared library $(LIBGRAY).so: $(MODULES) | $(LIBDIR) - $(LD) -shared $(LDFLAGS) -o $@ $^ + $(LD) -shared $(LDFLAGS) -o '$@' $^ # GRAY static library $(LIBGRAY).a($(MODULES)): | $(LIBDIR) @@ -131,7 +131,7 @@ graph.svg: Makefile /->/ {if (bad[$$1] || bad[$$2]) next} \ {print $$0}' \ | sed 's/label/fontsize=30,label/g; s/\.o//' \ - | dot -Tsvg -o $@ + | dot -Tsvg -o '$@' ## ## Generic rules @@ -145,18 +145,18 @@ graph.svg: Makefile # Note 2: this assumes matching module/file names and no circular # dependencies (ie. the dependency graph is a DAG); $(OBJDIR)/%.d: $(SRCDIR)/%.f90 | $(OBJDIR) - @printf '$(@:d=o): $< \\\n' > $@ + @printf '$(@:d=o): $< \\\n' > '$@' @grep -v 'use iso_' '$<' | \ sed -n 's@^[^!].*use \([^,]\+\),.*@$(OBJDIR)/\1.o \\@p' | \ - sort -u >> $@ + sort -u >> '$@' # Load the generated rules include $(DEPS) # Compile a generic Fortran source $(OBJDIR)/%.o: $(SRCDIR)/%.f90 | $(OBJDIR) - $(FC) -cpp $(CPPFLAGS) $(FFLAGS) -c $< -o $@ + $(FC) -cpp $(CPPFLAGS) $(FFLAGS) -c '$<' -o '$@' # Create directories $(DIRS): - mkdir -p $@ + mkdir -p '$@' diff --git a/doc/Makefile b/doc/Makefile index 883fb18..e5d8c23 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -24,20 +24,20 @@ MANUALS = $(addprefix $(DOCDIR)/,manual.html manual.pdf res) .PHONY: all clean -all: $(MANUALS) +all: $(MANUALS) $(MANPAGES) clean: rm -r build $(DOCDIR)/manual.html: $(SECTIONS) res | $(DOCDIR) - pandoc $(FLAGS) $(HTML_FLAGS) $(filter %.md, $^) -o $@ + pandoc $(FLAGS) $(HTML_FLAGS) $(filter %.md, $^) -o '$@' $(DOCDIR)/res: res | $(DOCDIR) - cp -r $^ $@ + cp -r $^ '$@' $(DOCDIR)/manual.pdf: $(SECTIONS) | $(DOCDIR) - pandoc $(FLAGS) $(PDF_FLAGS) $^ -o $@ + pandoc $(FLAGS) $(PDF_FLAGS) $^ -o '$@' # Create directories $(DOCDIR): - mkdir -p $@ + mkdir -p '$@'