Skip to content

Commit

Permalink
build: keep original file when compressing
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Dec 17, 2023
1 parent 03e27cf commit acf438e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile.release
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Constants #
#############

SOURCE_FILE = src/envtpl.cr
OUTPUT_FILE = bin/envtpl-${TARGETOS}-${TARGETARCH}
COMPILE_OPTS = --threads 4 --release --error-trace --static
SOURCE_FILE = src/envtpl.cr
OUTPUT_FILE = bin/envtpl-${TARGETOS}-${TARGETARCH}
COMPILE_OPTS = --threads 4 --release --error-trace --static
COMPRESSED_FILE = $(OUTPUT_FILE)-upx

#########
# Tasks #
Expand All @@ -18,10 +19,11 @@ debug: ## Display build environment config
@echo "TARGETVARIANT: ${TARGETVARIANT}"
@echo "SOURCE_FILE: $(SOURCE_FILE)"
@echo "OUTPUT_FILE: $(OUTPUT_FILE)"
@echo "COMPRESSED_FILE: $(COMPRESSED_FILE)"

deps: debug ## Install production dependencies
shards install --production

release: deps ## Compile to production binary (static mode)
crystal build $(COMPILE_OPTS) -o $(OUTPUT_FILE) $(SOURCE_FILE)
upx $(OUTPUT_FILE)
upx -o $(COMPRESSED_FILE) $(OUTPUT_FILE)

0 comments on commit acf438e

Please sign in to comment.