summary refs log tree commit diff
path: root/vm
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-03-12 19:47:43 +0000
committerAlyssa Ross <hi@alyssa.is>2023-03-12 19:47:43 +0000
commit4b67ce2d6571addfb6784bd461675da8deca954b (patch)
tree7fa1d6325335d8fe040cb6081a0afa1d004e3b84 /vm
parente2ca1a7994adffea835b3e4f90ba1caf4f64f816 (diff)
downloadspectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar.gz
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar.bz2
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar.lz
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar.xz
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.tar.zst
spectrum-4b67ce2d6571addfb6784bd461675da8deca954b.zip
Build make targets directly into destinations
Our image Makefiles are either used for interactive development in a
nix-shell, or as part of a Nix build of Spectrum.  In neither of these
cases is the two step "make; make install" process useful like it is
for packages, because one image from Spectrum somewhere on the
development system isn't something it ever makes sense to do.

By removing the separation between building and installing, and
creating the final output directly in its destination, we can save
some copies of very large files, which should save seconds in each
build, even for the smaller components.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'vm')
-rw-r--r--vm/sys/net/Makefile6
-rw-r--r--vm/sys/net/default.nix6
2 files changed, 7 insertions, 5 deletions
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index cb294a4..afed270 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: EUPL-1.2+
-# SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2021-2023 Alyssa Ross <hi@alyssa.is>
 
 include ../../../lib/common.mk
 
+prefix = build/svc
+
 VMM = qemu
 
 HOST_BUILD_FILES = \
@@ -16,7 +18,7 @@ HOST_BUILD_FILES = \
 # intended to be part of the input, like temporary editor files or
 # .license files.  So for all these reasons, only explicitly listed
 # files are included in the build result.
-build/svc: $(HOST_BUILD_FILES)
+$(prefix): $(HOST_BUILD_FILES)
 	rm -rf $@
 	mkdir -p $@
 
diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix
index 852d5d0..2af46b2 100644
--- a/vm/sys/net/default.nix
+++ b/vm/sys/net/default.nix
@@ -79,9 +79,9 @@ stdenvNoCC.mkDerivation {
   PACKAGES_TAR = packagesTar;
   VMLINUX = "${kernel.dev}/vmlinux";
 
-  installPhase = ''
-    mv build/svc $out
-  '';
+  makeFlags = [ "prefix=$(out)" ];
+
+  dontInstall = true;
 
   enableParallelBuilding = true;