Skip to content

Commit

Permalink
update building script
Browse files Browse the repository at this point in the history
  • Loading branch information
xiam committed Aug 16, 2019
1 parent 371117e commit fd6bdc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ENV ANDROID_NDK_URL=https://dl.google.com/android/repository/android-ndk-r20-lin

ENV LIBPCAP_URL=https://www.tcpdump.org/release/libpcap-1.9.0.tar.gz

ENV GO_TARBALL=https://dl.google.com/go/go1.12.8.linux-amd64.tar.gz
ENV GO_TARBALL=https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz

# Android toolchain
RUN wget --quiet -O /opt/android-ndk.zip $ANDROID_NDK_URL
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ GH_OWNER ?= malfunkt
GH_REPO ?= arpfox
GH_ACCESS_TOKEN ?=

GO111MODULE ?= on

export GO111MODULE

define docker-run
docker run --rm \
-v $$PWD/$(BUILD_OUTPUT_DIR):/go/src/$(BUILD_PATH)/$(BUILD_OUTPUT_DIR) \
Expand All @@ -17,11 +21,11 @@ define docker-run
go build $(BUILD_FLAGS) -o $(BUILD_OUTPUT_DIR)/$(BIN_PREFIX)_$(2) $(BUILD_PATH)
endef

all: build-all

build: modules
go build $(BUILD_FLAGS) -o arpfox github.com/malfunkt/arpfox

all: docker-build

build-all: modules docker-builder clean
mkdir -p $(BUILD_OUTPUT_DIR) && \
parallel -v --halt now,fail=1 $(MAKE) ::: \
Expand Down Expand Up @@ -89,7 +93,7 @@ docker-builder:
docker build -t $(DOCKER_IMAGE) .

modules:
GO111MODULE=on go mod vendor
go mod vendor

clean:
rm -f *.db && \
Expand Down

0 comments on commit fd6bdc6

Please sign in to comment.