Skip to content

Commit

Permalink
Use exist-depends for directories
Browse files Browse the repository at this point in the history
Make sure that objects don't depend on the timestamp of the (built)
directory that they're in.

Signed-off-by: Peter Chubb <[email protected]>
  • Loading branch information
wom-bat authored and alexandermbrown committed Jul 22, 2024
1 parent 3efe454 commit 46baa1e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions examples/virtio-snd/virtio_snd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,31 @@ $(IMAGE_FILE) $(REPORT_FILE): $(IMAGES) $(SYSTEM_FILE)
%_vm:
mkdir -p $@

client_vm/rootfs.cpio.gz: $(SYSTEM_DIR)/client_vm/rootfs.cpio.gz client_vm
client_vm/rootfs.cpio.gz: $(SYSTEM_DIR)/client_vm/rootfs.cpio.gz |client_vm
cp $< $@

snd_driver_vm/rootfs.cpio.gz: snd_driver_vm $(SYSTEM_DIR)/snd_driver_vm/rootfs.cpio.gz $(SND_DRIVER_VM_USERLEVEL) $(SND_DRIVER_VM_USERLEVEL_INIT)
snd_driver_vm/rootfs.cpio.gz: $(SYSTEM_DIR)/snd_driver_vm/rootfs.cpio.gz $(SND_DRIVER_VM_USERLEVEL) $(SND_DRIVER_VM_USERLEVEL_INIT) |snd_driver_vm
$(LIBVMM)/tools/packrootfs $(SYSTEM_DIR)/snd_driver_vm/rootfs.cpio.gz snd_driver_vm/rootfs -o $@ \
--startup $(SND_DRIVER_VM_USERLEVEL_INIT) \
--home $(SND_DRIVER_VM_USERLEVEL)

%_vm/vm.dts: $(SYSTEM_DIR)/%_vm/dts/linux.dts $(SYSTEM_DIR)/%_vm/dts/overlays/*.dts
$(LIBVMM)/tools/dtscat $^ > $@

%_vm/vm.dtb: %_vm/vm.dts %_vm
%_vm/vm.dtb: %_vm/vm.dts |%_vm
$(DTC) -q -I dts -O dtb $< > $@

%_vm/vmm.o: $(VIRTIO_EXAMPLE)/%_vmm.c $(CHECK_FLAGS_BOARD_MD5) %_vm
%_vm/vmm.o: $(VIRTIO_EXAMPLE)/%_vmm.c $(CHECK_FLAGS_BOARD_MD5) |%_vm
$(CC) $(CFLAGS) -c -o $@ $<

%_vm/images.o: %_vm $(LIBVMM)/tools/package_guest_images.S $(SYSTEM_DIR)/%_vm/linux %_vm/vm.dtb %_vm/rootfs.cpio.gz
%_vm/images.o: $(LIBVMM)/tools/package_guest_images.S $(SYSTEM_DIR)/%_vm/linux %_vm/vm.dtb %_vm/rootfs.cpio.gz
$(CC) -c -g3 -x assembler-with-cpp \
-DGUEST_KERNEL_IMAGE_PATH=\"$(SYSTEM_DIR)/$</linux\" \
-DGUEST_DTB_IMAGE_PATH=\"$</vm.dtb\" \
-DGUEST_INITRD_IMAGE_PATH=\"$</rootfs.cpio.gz\" \
-DGUEST_KERNEL_IMAGE_PATH=\"$(SYSTEM_DIR)/$(@D)/linux\" \
-DGUEST_DTB_IMAGE_PATH=\"$(@D)/vm.dtb\" \
-DGUEST_INITRD_IMAGE_PATH=\"$(@D)/rootfs.cpio.gz\" \
-target $(TARGET) \
$(LIBVMM)/tools/package_guest_images.S -o $@

# Stop make from deleting intermediate files
client_vm_files:: client_vm client_vm/vm.dts client_vm/vm.dtb client_vm/rootfs.cpio.gz client_vm/images.o client_vm/vmm.o
snd_driver_vm_files:: snd_driver_vm snd_driver_vm/vm.dts snd_driver_vm/vm.dtb snd_driver_vm/rootfs.cpio.gz snd_driver_vm/images.o snd_driver_vm/vmm.o

qemu: $(IMAGE_FILE)
$(QEMU) -machine virt,virtualization=on,secure=off \
-cpu cortex-a53 \
Expand Down

0 comments on commit 46baa1e

Please sign in to comment.