Skip to content

Commit

Permalink
Merge pull request moby#2 from rtyler/freebsd-makefile
Browse files Browse the repository at this point in the history
Introduce a Makefile for building on FreeBSD
  • Loading branch information
R. Tyler Croy committed Sep 5, 2017
2 parents 9648f08 + 355e785 commit cc6924b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Makefile.freebsd
@@ -0,0 +1,55 @@
# This file exists to support the non-Docker-based build requirements for
# FreeBSD/Docker
#
export AUTO_GOPATH=1
export DEST_DIR=$(PWD)/bundles/bin
export RUNC_PATH="$(GOPATH)/src/github.com/opencontainers/runc"
export CONTAINERD_PATH="$(GOPATH)/src/github.com/containerd/containerd"
export LIBNETWORK_PATH="$(GOPATH)/src/github.com/docker/libnetwork"
export TINI_PATH="$(GOPATH)/tini"

binary: $(DEST_DIR)/docker-containerd $(DEST_DIR)/docker-proxy
./hack/make.sh binary

$(DEST_DIR)/docker-containerd: prepare
if [ ! -d $(CONTAINERD_PATH) ]; then \
git clone https://github.com/freebsd-docker/containerd.git $(CONTAINERD_PATH); \
fi;
cd $(CONTAINERD_PATH) && \
$(MAKE) && \
cp bin/containerd $(DEST_DIR)/docker-containerd && \
cp bin/containerd-shim $(DEST_DIR)/docker-containerd-shim && \
cp bin/ctr $(DEST_DIR)/docker-containerd-ctr

$(DEST_DIR)/docker-proxy: prepare
if [ ! -d $(LIBNETWORK_PATH) ]; then \
git clone https://github.com/freebsd-docker/libnetwork.git $(LIBNETWORK_PATH); \
fi;
cd $(LIBNETWORK_PATH) && \
go build -o $(DEST_DIR)/docker-proxy github.com/docker/libnetwork/cmd/proxy


runc:
if [ ! -d $(RUNC_PATH) ]; then \
git clone https://github.com/freebsd-docker/runc.git $(RUNC_PATH); \
fi;
cd $(RUNC_PATH) && \
$(MAKE)

tini: check-depends
if [ ! -d $(TINI_PATH) ]; then \
git clone https://github.com/krallin/tini.git $(TINI_PATH); \
fi;
cd $(TINI_PATH) && \
cmake . && \
$(MAKE) tini-static

check-depends:
echo ">> Verify that you have CMake installed"

prepare: bundles/bin

bundles/bin:
mkdir -p bundles/bin

.PHONY: check-depends prepare

0 comments on commit cc6924b

Please sign in to comment.