-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 752 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (25 loc) · 752 Bytes
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
UNAME := $(shell uname -s)
COMMAND := @echo Invalid operation system: $(UNAME)
HFOLDERS := -I php-src/Zend -I php-src -I php-src/ext -I php-src/main -I php-src/TSRM -I library
HICONV :=
LIB :=
ifeq ($(UNAME), Linux)
COMMAND := gcc -fPIC -shared
LIB := library/ast_linux.so
endif
ifeq ($(UNAME), Darwin)
COMMAND := clang -shared -undefined dynamic_lookup -Wattributes
LIB := library/ast_darwin.dylib
HICONV := --with-iconv=$(shell brew --prefix libiconv)
endif
all: clean
$(COMMAND) $(HFOLDERS) -o $(LIB) library/ast.c
debug: clean
$(COMMAND) $(HFOLDERS) -g -D DEBUG -o $(LIB) library/ast.c
.PHONY: clean
clean:
rm -rf $(LIB)
.PHONY: php-src
php-src:
cd php-src && ./buildconf --force
cd php-src && ./configure --disable-all $(HICONV)