-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: makefile windows compatibility
- Loading branch information
1 parent
98d56ba
commit 2649658
Showing
3 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,51 @@ | ||
ifeq ($(OS),Windows_NT) | ||
copy_config = powershell Copy-Item config.json bin -Force | ||
make_bin = powershell New-Item -ItemType Directory -Force -Path bin | powershell Out-Null | ||
output_file = bin\lwnsimulator.exe | ||
else | ||
copy_config = cp -f ./config.json ./bin/config.json | ||
make_bin = mkdir -p bin | ||
output_file = bin/lwnsimulator | ||
endif | ||
|
||
install-dep: | ||
@echo "\e[95mInstalling Deps\e[39m" | ||
@echo Installing Deps | ||
@go install github.com/rakyll/statik@latest | ||
@go mod download -x | ||
|
||
build: | ||
@echo "\e[96mBuilding the \e[95mLWN Simulator\e[39m" | ||
@echo "\e[96mBuilding the \e[94mUser Interface\e[39m" | ||
@cd webserver && statik -src=public | ||
@mkdir -p bin | ||
@cp -f config.json bin/config.json | ||
@echo "\e[96mBuilding the \e[93msource\e[39m" | ||
@go build -o bin/lwnsimulator cmd/main.go | ||
@echo "\e[92mBuild Complete\e[39m" | ||
@echo Starting the build the LWN Simulator | ||
@echo Baking the User Interface | ||
@cd webserver && statik -f -src=public | ||
@$(make_bin) | ||
@$(copy_config) | ||
@echo Building the source | ||
@go build -o $(output_file) cmd/main.go | ||
@echo Build Complete | ||
|
||
build-platform: | ||
@echo "\e[96mBuilding the \e[95mLWN Simulator (${SUFFIX})\e[39m" | ||
@echo "\e[96mBuilding the \e[94mUser Interface\e[39m" | ||
@echo Starting the build the LWN Simulator $(SUFFIX) | ||
@echo Baking the User Interface | ||
@cd webserver && statik -src=public | ||
@mkdir -p bin | ||
@cp -f config.json bin/config.json | ||
@echo "\e[96mBuilding the \e[93msource\e[39m" | ||
@go build -o bin/lwnsimulator${SUFFIX} cmd/main.go | ||
@echo "\e[92mBuild Complete\e[39m" | ||
@$(make_bin) | ||
@$(copy_config) | ||
@echo Building the source | ||
@go build -o bin//lwnsimulator$(SUFFIX) cmd/main.go | ||
@echo "Build Complete" | ||
|
||
build-x64: | ||
linux-build-x64: | ||
@make build-platform GOOS=linux GOARCH=amd64 SUFFIX="_x64" | ||
|
||
build-x86: | ||
linux-build-x86: | ||
@make build-platform GOOS=linux GOARCH=386 SUFFIX="_x86" | ||
|
||
build-all: | ||
linux-build-all: | ||
@make build-x64 | ||
@make build-x86 | ||
run: | ||
@echo "\e[96mBuilding the \e[94mUser Interface\e[39m" | ||
@cd webserver && statik -src=public | ||
@echo "\e[96mRunning\e[39m" | ||
@echo Baking the User Interface | ||
@cd webserver && statik -f -src=public | ||
@echo Running | ||
@go run cmd/main.go | ||
run-release: | ||
@bin/lwnsimulator | ||
@$(output_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters