diff --git a/contrib/nix/Makefile b/contrib/nix/Makefile index b71cf1f..ad8c65f 100644 --- a/contrib/nix/Makefile +++ b/contrib/nix/Makefile @@ -1,4 +1,4 @@ -CC := $(shell command -v musl-clang 2>/dev/null || echo gcc) +CC := $(shell command -v musl-clang 2> /dev/null || echo gcc) CFLAGS := -Os -static -ffunction-sections -fdata-sections LDFLAGS := -Wl,--gc-sections BUILDDIR ?= . @@ -6,10 +6,9 @@ SRC := vmctl_init.c OUT := $(BUILDDIR)/init IMG := $(BUILDDIR)/init.img -.PHONY: clean +.PHONY: clean all $(OUT): $(SRC) - @echo "Compiler: $(CC)" $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(IMG): $(OUT) @@ -19,3 +18,6 @@ all: $(IMG) clean: rm -f $(OUT) $(IMG) + +print-%: + @echo $* = $($*) diff --git a/lib/qemu/nix b/lib/qemu/nix index 0bddfeb..e98914e 100644 --- a/lib/qemu/nix +++ b/lib/qemu/nix @@ -35,14 +35,10 @@ _qemu_nix_create_nix_init () { _require_program "$(command -v musl-clang 2> /dev/null || echo gcc)" local make_path="${state_dir}/Makefile" - if [[ ! -f ${make_path} ]]; then - _add_pre_cmd "ln -s \"${BASEDIR}/contrib/nix/Makefile\" \"${make_path}\"" - fi + _add_pre_cmd "cp -f \"${BASEDIR}/contrib/nix/Makefile\" \"${make_path}\"" local c_init_path="${state_dir}/vmctl_init.c" - if [[ ! -f ${c_init_path} ]]; then - _add_pre_cmd "ln -s \"${BASEDIR}/contrib/nix/vmctl_init.c\" \"${c_init_path}\"" - fi + _add_pre_cmd "cp -f \"${BASEDIR}/contrib/nix/vmctl_init.c\" \"${c_init_path}\"" if [[ ${NIX_INIT_REBUILD} == "yes" ]]; then _add_pre_cmd "make -C \"${state_dir}\" clean"