This repository has been archived on 2021-10-25. You can view files and clone it, but cannot push or open issues/pull-requests.
rusty-bever/Makefile

44 lines
1000 B
Makefile
Raw Normal View History

2021-08-28 16:37:32 +02:00
# =====CONFIGURATION=====
# Version of postgresql to compile libpq from
2021-08-28 14:20:51 +02:00
PQ_VER ?= 11.12
2021-08-28 16:37:32 +02:00
# OpenSSL version
2021-08-28 12:41:43 +02:00
SSL_VER ?= 1.1.1k
2021-08-28 16:37:32 +02:00
# Dumb-init version
2021-08-28 14:20:51 +02:00
DI_VER ?= 1.2.5
2021-08-28 12:41:43 +02:00
# Compilation target triplet
# Supported targets: https://github.com/rust-embedded/cross#supported-targets
TARGET = x86_64-unknown-linux
CORES != nproc
2021-08-28 13:53:13 +02:00
2021-08-28 12:41:43 +02:00
.PHONY: all
all: build-debug
2021-08-28 14:20:51 +02:00
2021-09-05 11:19:18 +02:00
.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
2021-09-05 11:19:18 +02:00
# ====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