Skip to content

Commit

Permalink
Updated makefile (bench 8431417)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmoth committed Sep 29, 2024
1 parent ef9a36f commit 7d23b48
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ ifndef EXE
EXE = Sapling
endif

ifndef CC
CC = dotnet
endif

ifeq ($(OS),Windows_NT)
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
RUNTIME=win-x64
else ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
RUNTIME=win-x64
else
RUNTIME=win-x86
Expand All @@ -26,17 +24,24 @@ else
else ifneq ($(filter arm%,$(UNAME_P)),)
RUNTIME=linux-arm
endif
else ifneq ($(filter arm%,$(UNAME_P)),)
RUNTIME=osx-arm64
else
RUNTIME=osx-x64
else ifeq ($(UNAME_S),Darwin)
ifneq ($(filter arm%,$(UNAME_P)),)
RUNTIME=osx-arm64
else
RUNTIME=osx-x64
endif
endif
endif

# Extract the output directory from the EXE path (everything before the last slash)
OUTPUT_DIR := $(dir $(EXE))

ifdef EXE
OUTPUT_DIR=./
endif
# Extract the filename from the EXE path (everything after the last slash, without extension)
ASSEMBLY_NAME := $(notdir $(basename $(EXE)))

# Create the output directory if it doesn't exist
publish:
dotnet publish Sapling/Sapling.csproj -c Release --runtime ${RUNTIME} --self-contained -p:Optimized=true -p:DeterministicBuild=true -p:AssemblyName=$(EXE) -p:DebugType=embedded -o '${OUTPUT_DIR}'
@if [ ! -d "$(OUTPUT_DIR)" ]; then mkdir -p $(OUTPUT_DIR); fi
dotnet publish Sapling/Sapling.csproj -c Release --runtime $(RUNTIME) --self-contained \
-p:PublishSingleFile=true -p:DeterministicBuild=true \
-p:AssemblyName=$(ASSEMBLY_NAME) -p:DebugType=embedded -o $(OUTPUT_DIR)

0 comments on commit 7d23b48

Please sign in to comment.