]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
tools/ocaml: Drop the o= variable
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 23 Aug 2024 10:18:25 +0000 (11:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 23 Aug 2024 14:02:27 +0000 (15:02 +0100)
This hides a shell redirection which is quite rude.  It also opencodes
$(move-if-changed) without the benefit of short-circuiting dependent logic
when the content hasn't changed.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@cloud.com>
Reviewed-by: Edwin Török <edwin.torok@cloud.com>
tools/ocaml/Makefile.rules
tools/ocaml/common.make

index 5638193edf8a60e3a95cca609351940d021b04ab..5d534d8754bf58041b569568cef3142596f137a0 100644 (file)
@@ -40,13 +40,14 @@ ALL_OCAML_OBJS ?= $(OBJS)
        $(call quiet-command, $(CC) $(CFLAGS) -c -o $@ $<,CC,$@)
 
 META: META.in
-       sed 's/@VERSION@/$(VERSION)/g' < $< $o
+       sed 's/@VERSION@/$(VERSION)/g' < $< > $@.tmp
+       $(call move-if-changed,$@.tmp,$@)
 
 ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 
 ifneq ($(MAKECMDGOALS),clean)
 .ocamldep.make: $(ALL_OCAML_OBJ_SOURCES) Makefile $(OCAML_TOPLEVEL)/Makefile.rules
-       $(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli $o,MLDEP,)
+       $(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli > $@.tmp; $(call move-if-changed,$@.tmp,$@),MLDEP,)
 endif
 
 clean: $(CLEAN_HOOKS)
index 708d74617c8db2d5b63df9cd6ab3ed355bcb479c..979cbe08459bc2dc20a1f48302f34deb22c66ad6 100644 (file)
@@ -17,5 +17,3 @@ OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 VERSION := 4.1
 
 OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
-
-o= >$@.new && mv -f $@.new $@