Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
amdzy committed Mar 11, 2024
1 parent bd8eb64 commit 0e4d51f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

CLI_PROJECT_NAME := NetManager.Cli
ARTIFACT_FOLDER := artifacts
OUTPUT_FOLDER := bin/Release/net8.0/publish

## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

## clean: clean build artifacts
.PHONY: clean
clean:
dotnet clean
rm -rf $(ARTIFACT_FOLDER)

## publish/cli/all: Publish the cli app for all archtype
.PHONY: publish/cli/all
publish/cli/all: publish/cli/linux/x64 publish/cli/osx/x64 publish/cli/win/x64

## publish/cli/linux/x64: Publish the cli app for linux-x64
.PHONY: publish/cli/linux/x64
publish/cli/linux/x64:
dotnet publish -c Release -r linux-x64 -o ${ARTIFACT_FOLDER} $(CLI_PROJECT_NAME)
mv ${ARTIFACT_FOLDER}/NetManager.Cli ${ARTIFACT_FOLDER}/netManager
tar czf ${ARTIFACT_FOLDER}/NetManager_linx_x64.tar.gz -C ${ARTIFACT_FOLDER} netManager
rm ${ARTIFACT_FOLDER}/netManager

## publish/cli/osx/x64: Publish the cli app for osx-x64
.PHONY: publish/cli/osx/x64
publish/cli/osx/x64:
dotnet publish -c Release -r osx-x64 -o ${ARTIFACT_FOLDER} $(CLI_PROJECT_NAME)
mv ${ARTIFACT_FOLDER}/NetManager.Cli ${ARTIFACT_FOLDER}/netManager
tar czf ${ARTIFACT_FOLDER}/NetManager_osx_x64.tar.gz -C ${ARTIFACT_FOLDER} netManager
rm ${ARTIFACT_FOLDER}/netManager

## publish/cli/win/x64: Publish the cli app for win-x64
.PHONY: publish/cli/win/x64
publish/cli/win/x64:
dotnet publish -c Release -r win-x64 -o ${ARTIFACT_FOLDER} $(CLI_PROJECT_NAME)
mv ${ARTIFACT_FOLDER}/NetManager.Cli.exe ${ARTIFACT_FOLDER}/netManager.exe
zip -j ${ARTIFACT_FOLDER}/NetManager_win_x64.zip ${ARTIFACT_FOLDER}/netManager.exe
rm ${ARTIFACT_FOLDER}/netManager.exe

0 comments on commit 0e4d51f

Please sign in to comment.