Skip to content

Commit

Permalink
make: Cross-compile pwru target
Browse files Browse the repository at this point in the history
Signed-off-by: Martynas Pumputis <m@lambda.lt>
  • Loading branch information
brb committed Jul 6, 2023
1 parent 0b59297 commit e7019e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ jobs:
directory: $HOME/.clang
cached: ${{ steps.cache-llvm.outputs.cache-hit }}

- name: Compile libpcap.a
run: make libpcap/libpcap.a

- name: Generate and build
run: make pwru

Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ GO_BUILD = CGO_ENABLED=1 $(GO) build
GO_GENERATE = $(GO) generate
GO_TAGS ?=
TARGET_GOARCH ?= amd64
GOARCH ?= amd64
TARGET=pwru
INSTALL = $(QUIET)install
BINDIR ?= /usr/local/bin
VERSION=$(shell git describe --tags --always)
LIBPCAP_ARCH ?= x86_64-unknown-linux-gnu
LIBPCAP_CC ?= gcc
# For compiling libpcap and CGO
CC ?= gcc

TEST_TIMEOUT ?= 5s

$(TARGET): libpcap/libpcap.a
TARGET_GOARCH=$(TARGET_GOARCH) $(GO_GENERATE)
$(GO_BUILD) $(if $(GO_TAGS),-tags $(GO_TAGS)) \
CC=$(CC) GOARCH=$(TARGET_GOARCH) $(GO_BUILD) $(if $(GO_TAGS),-tags $(GO_TAGS)) \
-ldflags "-w -s \
-X 'github.com/cilium/pwru/internal/pwru.Version=${VERSION}'"

Expand Down

0 comments on commit e7019e2

Please sign in to comment.