Skip to content

Commit

Permalink
Make appending to FLAGS possible when invoking make. (#499)
Browse files Browse the repository at this point in the history
* Make appending to FLAGS possible when invoking make.

* Remove extra space in string.

---------

Co-authored-by: Adrian Macneil <[email protected]>
  • Loading branch information
dossy and amacneil authored Nov 26, 2023
1 parent c641805 commit e4938eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# enable cgo to build sqlite
export CGO_ENABLED = 1

# strip binaries
FLAGS := -tags sqlite_omit_load_extension,sqlite_json -ldflags '-s'

# default output file
OUTPUT ?= dbmate

# platform-specific settings
GOOS := $(shell go env GOOS)
ifeq ($(GOOS),linux)
# statically link binaries to support alpine linux
FLAGS := -tags netgo,osusergo,sqlite_omit_load_extension,sqlite_json -ldflags '-s -extldflags "-static"'
override FLAGS := -tags netgo,osusergo,sqlite_omit_load_extension,sqlite_json -ldflags '-s -extldflags "-static"' $(FLAGS)
else
# strip binaries
override FLAGS := -tags sqlite_omit_load_extension,sqlite_json -ldflags '-s' $(FLAGS)
endif
ifeq ($(GOOS),darwin)
export SDKROOT ?= $(shell xcrun --sdk macosx --show-sdk-path)
Expand Down

0 comments on commit e4938eb

Please sign in to comment.