-
Notifications
You must be signed in to change notification settings - Fork 398
Expand file tree
/
Copy pathmakefile
More file actions
51 lines (35 loc) · 1.95 KB
/
makefile
File metadata and controls
51 lines (35 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
POSTGRES_VERSION=17.4
POSTGRES_DOWNLOAD_URL=https://ftp.postgresql.org/pub/source/v$(POSTGRES_VERSION)
# compiler options
MACOSX_DEPLOYMENT_TARGET=10.15
CFLAGS=-arch arm64 -arch x86_64 -mmacosx-version-min=10.15 -g -Os
CXXFLAGS=-arch arm64 -arch x86_64 -mmacosx-version-min=10.15 -g -Os
export CFLAGS CXXFLAGS MACOSX_DEPLOYMENT_TARGET
# command shortcuts
CURL=/usr/bin/curl -L10 --silent --show-error --remote-name
TAR=/usr/bin/tar xzf
all: postgresql
clean: clean-postgresql
download: postgresql-$(POSTGRES_VERSION).tar.bz2
#########################
###### PostgreSQL #######
#########################
postgresql: libpq.a postgres_ext.h libpq-fe.h pg_config_ext.h
postgres_ext.h: postgresql-$(POSTGRES_VERSION)/GNUmakefile
cp postgresql-$(POSTGRES_VERSION)/src/include/postgres_ext.h postgres_ext.h
pg_config_ext.h: postgresql-$(POSTGRES_VERSION)/GNUmakefile
cp postgresql-$(POSTGRES_VERSION)/src/include/pg_config_ext.h pg_config_ext.h
libpq-fe.h: postgresql-$(POSTGRES_VERSION)/GNUmakefile
cp postgresql-$(POSTGRES_VERSION)/src/interfaces/libpq/libpq-fe.h libpq-fe.h
libpq.a: postgresql-$(POSTGRES_VERSION)/GNUmakefile
MAKELEVEL=0 make -C postgresql-$(POSTGRES_VERSION)/src/interfaces/libpq all-static-lib
cp postgresql-$(POSTGRES_VERSION)/src/interfaces/libpq/libpq.a postgresql-$(POSTGRES_VERSION)/src/port/libpgport.a postgresql-$(POSTGRES_VERSION)/src/common/libpgcommon.a postgresql-$(POSTGRES_VERSION)/src/common/libpgcommon_shlib.a .
postgresql-$(POSTGRES_VERSION)/GNUmakefile: postgresql-$(POSTGRES_VERSION)/configure
cd "postgresql-$(POSTGRES_VERSION)" && export PATH="$(PREFIX)/bin:$$PATH" && ./configure --prefix=$(CURDIR)/install --without-icu
postgresql-$(POSTGRES_VERSION)/configure: postgresql-$(POSTGRES_VERSION).tar.bz2
$(TAR) "postgresql-$(POSTGRES_VERSION).tar.bz2"
touch $@
postgresql-$(POSTGRES_VERSION).tar.bz2:
$(CURL) "$(POSTGRES_DOWNLOAD_URL)/postgresql-$(POSTGRES_VERSION).tar.bz2"
clean-postgresql:
rm -Rf postgresql-$(POSTGRES_VERSION)