-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 1.09 KB
/
Makefile
File metadata and controls
31 lines (26 loc) · 1.09 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
DEBUG ?= 0
PHP_INCLUDES := $(shell php-config --includes)
PHP_LDFLAGS := $(shell php-config --ldflags)
PHP_LIBS := $(shell php-config --libs)
ifeq ($(DEBUG),1)
XCADDY_FLAGS := -gcflags='all=-N -l' -tags=nobadger,nomysql,nopgx,nodphp,nobrotli
else
XCADDY_FLAGS := -ldflags='-w -s' -tags=nobadger,nomysql,nopgx,nodphp,nobrotli
endif
LOCAL_MODULE := /home/withinboredom/code/durable-php/cli
GEN_STUB := /home/withinboredom/code/php-src/build/gen_stub.php
LOCAL_FRANKENPHP_CADDY := /home/withinboredom/code/frankenphp/caddy
LOCAL_FRANKENPHP := /home/withinboredom/code/frankenphp
# Targets
frankenphp: ext/build/ext.go ext/build/ext_arginfo.h
CGO_ENABLED=1 \
XCADDY_GO_BUILD_FLAGS="$(XCADDY_FLAGS)" \
CGO_CFLAGS="$(PHP_INCLUDES)" \
CGO_LDFLAGS="$(PHP_LDFLAGS) $(PHP_LIBS)" \
xcaddy build \
--output frankenphp \
--with github.com/dunglas/frankenphp/caddy=$(LOCAL_FRANKENPHP_CADDY) \
--with github.com/dunglas/frankenphp=$(LOCAL_FRANKENPHP) \
--with github.com/bottledcode/durable-php/cli=$(LOCAL_MODULE)
ext/build/ext_arginfo.h: ext/build/ext.stub.php
$(GEN_STUB) ext/build/ext.stub.php ext/build