Skip to content

Commit

Permalink
Improve Makefile for build on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpo-head committed Oct 28, 2021
1 parent 80f4031 commit 95f4df7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
WINDOWS_DISTROD_PROJECT_PATH ?= distrod
OUTPUT_ROOTFS_PATH ?= $(WINDOWS_DISTROD_PROJECT_PATH)/distrod_wsl_launcher/resources/distrod_root.tar.gz
OUTPUT_ROOTFS_PATH ?= opt_distrod.tar.gz

build: distrod-release

rootfs:
./distrod_packer/distrod_packer ./distrod $(OUTPUT_ROOTFS_PATH)

distrod-release: distrod-bins distrod/target/release/portproxy.exe
./distrod_packer/distrod_packer ./distrod opt_distrod.tar.gz --pack-distrod-opt-dir
./distrod_packer/distrod_packer ./distrod $(OUTPUT_ROOTFS_PATH) --pack-distrod-opt-dir

distrod-bins:
cd distrod; cargo build --release -p distrod -p distrod-exec -p portproxy
Expand All @@ -34,11 +33,18 @@ test-linux: lint unit-test-linux integration-test-linux
lint:
shellcheck install.sh

clean:
cd distrod; cargo clean; cargo.exe clean

ifneq ($(shell uname -a | grep microsoft),) # This is a WSL environment, which means you can run .exe
ROOTFS_PATH = $(OUTPUT_ROOTFS_PATH)
OUTPUT_PORT_PROXY_EXE_PATH = distrod/target/release/portproxy.exe
distrod_wsl_launcher: distrod-release

$(ROOTFS_PATH): distrod-release
include windows.mk

.PHONY: $(ROOTFS_PATH)
endif

.PHONY: build rootfs distrod-release distrod-bins lint unit-test-linux integration-test-linux integration-test-linux-all-distros test-linux
.PHONY: build rootfs distrod-release distrod-bins lint clean\
unit-test-linux enter-integration-test-linux integration-test-linux integration-test-linux-all-distros test-linux

0 comments on commit 95f4df7

Please sign in to comment.