-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 891 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 891 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
32
CC := gcc
PHPDIR ?= /opt/phpts
PHPSO ?= php7
PHPINC := $(PHPDIR)/include/php
CFLAGS := -g -O2 -Wall -I$(PHPINC) -I$(PHPINC)/ext -I$(PHPINC)/main -I$(PHPINC)/sapi -I$(PHPINC)/TSRM -I$(PHPINC)/Zend $(CFLAGS)
LDFLAGS := -L$(PHPDIR)/lib -Wl,-rpath,$(PHPDIR)/lib -l$(PHPSO) -pthread -rdynamic $(LDFLAGS)
all: $(PHPINC)
@echo -n
$(PHPINC):
$(error The $@ is not directory. Please usage "make PHPDIR=<dir>" by php dir, for example: /opt/phpts)
all: $(PHPDIR)/lib/lib$(PHPSO).so
$(PHPDIR)/lib/lib$(PHPSO).so:
$(error The $@ is not directory. Please usage "make PHPDIR=<dir>" by php dir, for example: /opt/phpts)
all: threadtask
threadtask: main.o func.o hash.o strnatcmp.o
@echo LD $@
@$(CC) -o $@ $^ $(LDFLAGS)
main.o: func.h
func.o: func.h hash.h
hash.o: hash.h
%.o: %.c
@echo CC $@
@$(CC) $(CFLAGS) -c -o $@ $<
clean:
@LANG=en rm -vf *.o threadtask