Skip to content

Commit 7c575c6

Browse files
author
Ibrahim Ethem Gursoy
committed
Create Makefile
1 parent a8df64e commit 7c575c6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.PHONY: all clean linux-x64 win-x64 linux-arm64 linux-arm
2+
3+
linux-x64:
4+
dotnet publish -c Release -r linux-x64 -p:PublishDir=bin/publish_dist/linux-x64/ -p:PublishSingleFile=true --self-contained true
5+
win-x64:
6+
dotnet publish -c Release -r win-x64 -p:PublishDir=bin/publish_dist/win-x64/ -p:PublishSingleFile=true --self-contained true
7+
linux-arm64:
8+
dotnet publish -c Release -r linux-arm64 -p:PublishDir=bin/publish_dist/linux-arm64/ -p:PublishSingleFile=true --self-contained true
9+
linux-arm:
10+
dotnet publish -c Release -r linux-arm -p:PublishDir=bin/publish_dist/linux-arm/ -p:PublishSingleFile=true --self-contained true
11+
12+
all: | linux-x64 win-x64 linux-arm64 linux-arm
13+
14+
dist: | all
15+
ifeq ($(OS), Windows_NT)
16+
# Windows-specific commands
17+
@echo "Creating zip file in Windows"
18+
powershell Compress-Archive -Path bin/publish_dist/* -DestinationPath bin/publish_dist.zip
19+
else
20+
# Linux commands
21+
@echo "Creating tar.gz file in Linux"
22+
cd ./bin/publish_dist/; tar -czvf ../publish_dist.tar.gz *
23+
endif
24+
25+
clean:
26+
ifeq ($(OS), Windows_NT)
27+
# Windows-specific commands
28+
if exist bin\ (rmdir /s /q bin) else echo "bin not found, skipping clean"
29+
if exist obj\ (rmdir /s /q obj) else echo "obj not found, skipping clean"
30+
else
31+
# Linux commands
32+
@if [ -d bin ]; then rm -rf bin; else echo "bin not found, skipping clean"; fi
33+
@if [ -d obj ]; then rm -rf obj; else echo "obj not found, skipping clean"; fi
34+
endif

0 commit comments

Comments
 (0)