CC := gcc TEST_SOCKET := /tmp/qemu-shim-test.socket ANALYZE := -fanalyzer bin/qemu-shim: bin ${CC} main.c -pedantic -std=c11 -Wall -o $@ test: clean bin/qemu-shim bin/fake-qemu TEST_SOCKET=${TEST_SOCKET} ./test.sh clean: rm -r bin 2>/dev/null || true install: bin/qemu-shim install -m 0755 bin/qemu-shim /usr/bin install -m 0644 contrib/qemu-shim@.service /usr/lib/systemd/user install -m 0644 contrib/qemu-shim@.service /usr/lib/systemd/system uninstall: [[ -f /usr/bin/qemu-shim ]] && rm -v /usr/bin/qemu-shim || true [[ -f /usr/lib/systemd/user/qemu-shim@.service ]] && \ rm -v /usr/lib/systemd/user/qemu-shim@.service || true [[ -f /usr/lib/systemd/system/qemu-shim@.service ]] && \ rm -v /usr/lib/systemd/system/qemu-shim@.service || true bin/fake-qemu: bin echo "#!/bin/sh" > $@ echo "socat -v unix-listen:${TEST_SOCKET} /dev/null" >> $@ echo "exit 0" >> $@ chmod +x $@ analyze: bin ${CC} main.c ${ANALYZE} -pedantic -std=c11 -Wall -o /dev/null bin: mkdir -p bin