Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
build static C library on Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed Nov 1, 2018
1 parent b60af89 commit cc255a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DEPS_C = $(SRC_DIR)/*.h $(SRC_DIR)/*.hpp $(SRC_DIR)/*.c
DEPS_GO = $(SRC_DIR)/*.go gen_header.go vendor

BUILD_MODE=-buildmode=c-shared
BUILD_MODE_STATIC=-buildmode=c-archive
GO_BUILD=go build
CC_WIN64=x86_64-w64-mingw32-gcc
CC_WIN32=i686-w64-mingw32-gcc
Expand Down Expand Up @@ -56,6 +57,7 @@ vendor: Gopkg.*
build-linux: $(DEPS_C) $(DEPS_GO)
mkdir -p $(OUT_LINUX) && \
GOOS=linux GOARCH=amd64 $(GO_BUILD) $(BUILD_MODE) -o=$(OUT_LINUX)/$(OUT_NAME).so $(SRC_DIR)/ && \
GOOS=linux GOARCH=amd64 $(GO_BUILD) $(BUILD_MODE_STATIC) -o=$(OUT_LINUX)/$(OUT_NAME).a $(SRC_DIR)/ && \
$(GEN_HEADER) $(OUT_LINUX)/$(OUT_HEADER) && \
$(CP_HEADERS) $(OUT_LINUX)/

Expand Down

0 comments on commit cc255a3

Please sign in to comment.