Added some comments
parent
055d1f9e8d
commit
de8be87036
19
Makefile
19
Makefile
|
@ -1,20 +1,27 @@
|
||||||
|
# =====CONFIGURATION=====
|
||||||
|
# Version of postgresql to compile libpq from
|
||||||
PQ_VER ?= 11.12
|
PQ_VER ?= 11.12
|
||||||
|
# OpenSSL version
|
||||||
SSL_VER ?= 1.1.1k
|
SSL_VER ?= 1.1.1k
|
||||||
|
# Dumb-init version
|
||||||
DI_VER ?= 1.2.5
|
DI_VER ?= 1.2.5
|
||||||
|
|
||||||
|
|
||||||
# Generated variables for ease of use
|
# =====AUTO-GENERATED VARIABLES=====
|
||||||
# This is such a lovely oneliner
|
# This is such a lovely oneliner
|
||||||
# NOTE: $(dir PATH) outputs a trailing slash
|
# NOTE: $(dir PATH) outputs a trailing slash
|
||||||
OUT_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))out
|
OUT_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))out
|
||||||
|
|
||||||
PREFIX := $(OUT_DIR)/prefix
|
PREFIX := $(OUT_DIR)/prefix
|
||||||
OPENSSL_DIR := $(OUT_DIR)/openssl-$(SSL_VER)
|
OPENSSL_DIR := $(OUT_DIR)/openssl-$(SSL_VER)
|
||||||
PQ_DIR := $(OUT_DIR)/postgresql-$(PQ_VER)
|
PQ_DIR := $(OUT_DIR)/postgresql-$(PQ_VER)
|
||||||
DI_DIR := $(OUT_DIR)/dumb-init-$(DI_VER)
|
DI_DIR := $(OUT_DIR)/dumb-init-$(DI_VER)
|
||||||
|
|
||||||
|
# Used in various make calls to specify parallel recipes
|
||||||
CORES != nproc
|
CORES != nproc
|
||||||
|
|
||||||
|
|
||||||
|
# =====ENVIRONMENT VARIABLES=====
|
||||||
export CC=musl-gcc -fPIC -pie -static
|
export CC=musl-gcc -fPIC -pie -static
|
||||||
export LD_LIBRARY_PATH=$(PREFIX)
|
export LD_LIBRARY_PATH=$(PREFIX)
|
||||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||||
|
@ -25,6 +32,8 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||||
# Create the out dir
|
# Create the out dir
|
||||||
$(shell mkdir -p "$(PREFIX)")
|
$(shell mkdir -p "$(PREFIX)")
|
||||||
|
|
||||||
|
|
||||||
|
# ====RECIPES====
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
@ -32,6 +41,11 @@ all: build
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: libpq
|
build: libpq
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
@ echo "Note: this only cleans the C dependencies, not the Cargo cache."
|
||||||
|
rm -rf "$(PQ_DIR)" "$(OPENSSL_DIR)" "$(DI_DIR)" "$(PREFIX)"
|
||||||
|
|
||||||
|
|
||||||
# =====OPENSSL=====
|
# =====OPENSSL=====
|
||||||
# Download the source code & configure the project
|
# Download the source code & configure the project
|
||||||
|
@ -62,8 +76,8 @@ $(PQ_DIR)/configure:
|
||||||
cd "$(PQ_DIR)" && \
|
cd "$(PQ_DIR)" && \
|
||||||
LDFLAGS="-L$(PREFIX)/lib" CFLAGS="-I$(PREFIX)/include" ./configure \
|
LDFLAGS="-L$(PREFIX)/lib" CFLAGS="-I$(PREFIX)/include" ./configure \
|
||||||
--without-readline \
|
--without-readline \
|
||||||
--without-zlib \
|
|
||||||
--with-openssl \
|
--with-openssl \
|
||||||
|
--without-zlib \
|
||||||
--prefix="$(PREFIX)" \
|
--prefix="$(PREFIX)" \
|
||||||
--host=x86_64-unknown-linux-musl
|
--host=x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
@ -81,5 +95,6 @@ $(DI_DIR)/Makefile:
|
||||||
curl -sSL "https://github.com/Yelp/dumb-init/archive/refs/tags/v$(DI_VER).tar.gz" | \
|
curl -sSL "https://github.com/Yelp/dumb-init/archive/refs/tags/v$(DI_VER).tar.gz" | \
|
||||||
tar -C "$(OUT_DIR)" -xz
|
tar -C "$(OUT_DIR)" -xz
|
||||||
|
|
||||||
|
.PHONY: dumb-init
|
||||||
dumb-init: $(DI_DIR)/Makefile
|
dumb-init: $(DI_DIR)/Makefile
|
||||||
make -C "$(DI_DIR)" build
|
make -C "$(DI_DIR)" build
|
||||||
|
|
Reference in New Issue