44 lines
1000 B
Makefile
44 lines
1000 B
Makefile
# =====CONFIGURATION=====
|
|
# Version of postgresql to compile libpq from
|
|
PQ_VER ?= 11.12
|
|
# OpenSSL version
|
|
SSL_VER ?= 1.1.1k
|
|
# Dumb-init version
|
|
DI_VER ?= 1.2.5
|
|
|
|
# Compilation target triplet
|
|
# Supported targets: https://github.com/rust-embedded/cross#supported-targets
|
|
TARGET = x86_64-unknown-linux
|
|
CORES != nproc
|
|
|
|
.PHONY: all
|
|
all: build-debug
|
|
|
|
.PHONY: builder
|
|
builder:
|
|
docker build \
|
|
--build-arg TARGET=$(TARGET) \
|
|
--build-arg CORES=$(CORES) \
|
|
--build-arg SSL_VER=$(SSL_VER) \
|
|
--build-arg PQ_VER=$(PQ_VER) \
|
|
--tag rusty-builder:$(TARGET) \
|
|
--file Dockerfile.build \
|
|
.
|
|
|
|
.PHONY: build-debug
|
|
build-debug: builder
|
|
cross build --target "$(TARGET)-musl"
|
|
|
|
.PHONY: run
|
|
run: builder
|
|
docker-compose up -d --build && docker-compose logs -f app
|
|
|
|
.PHONY: release
|
|
build-release: builder
|
|
cross build --target "$(TARGET)-musl" --release
|
|
|
|
# ====UTILITIES FOR DEVELOPMENT=====
|
|
## The tests require a database, so we run them like this
|
|
test:
|
|
docker-compose -f docker-compose.test.yml -p rb_test up
|