Skip to content

Commit

Permalink
change make, config files
Browse files Browse the repository at this point in the history
  • Loading branch information
monque committed Jan 20, 2016
1 parent 318ae17 commit 52b8638
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -28,8 +28,8 @@
*.x86_64
*.hex

# Cmdtool
cmdtool/phptrace
# Cli
src/phptrace

# Extension
extension/.deps
Expand All @@ -42,6 +42,7 @@ extension/acinclude.m4
extension/aclocal.m4
extension/autom4te.cache
extension/build
extension/deps
extension/common
extension/confdefs.h
extension/config.cache
Expand Down
12 changes: 6 additions & 6 deletions extension/Makefile.frag
Expand Up @@ -7,15 +7,15 @@ PHP_TRACE_BINDIR = ` \
$(top_srcdir)/build/shtool path -d "${PHP_EXECUTABLE}"; \
fi`
install-tracetool: tracetool
install-cli: tracetool
-@$(mkinstalldirs) $(INSTALL_ROOT)${PHP_TRACE_BINDIR}
@echo "Installing PHP Trace binary: $(INSTALL_ROOT)${PHP_TRACE_BINDIR}/"
@$(INSTALL) $(builddir)/../cmdtool/phptrace $(INSTALL_ROOT)${PHP_TRACE_BINDIR}
@$(INSTALL) $(builddir)/../src/phptrace $(INSTALL_ROOT)${PHP_TRACE_BINDIR}
clean-tracetool:
cd ../cmdtool && make clean
cd ../src && make clean
tracetool: $(builddir)/../cmdtool/phptrace
tracetool: $(builddir)/../src/phptrace
$(builddir)/../cmdtool/phptrace:
cd ../cmdtool && make
$(builddir)/../src/phptrace:
cd ../src && make
6 changes: 4 additions & 2 deletions extension/config.m4
Expand Up @@ -5,7 +5,7 @@ if test "$PHP_TRACE" != "no"; then

dnl check ZTS support
if test "$PHP_THREAD_SAFETY" == "yes"; then
AC_MSG_ERROR([currently trace does not support ZTS])
AC_MSG_ERROR([Trace does not support ZTS])
fi

dnl check mmap functions
Expand All @@ -17,16 +17,18 @@ if test "$PHP_TRACE" != "no"; then
common/trace_ctrl.c \
common/trace_mmap.c \
common/trace_type.c \
common/sds/sds.c"
deps/sds/sds.c"

dnl $ext_srcdir available after PHP_NEW_EXTENSION
PHP_NEW_EXTENSION(trace, trace.c $PHP_TRACE_COMMON_FILES, $ext_shared)

dnl configure can't use ".." as a source filename, so we make a link here
ln -sf $ext_srcdir/../common $ext_srcdir
ln -sf $ext_srcdir/../deps $ext_srcdir

dnl add common include path
PHP_ADD_INCLUDE($ext_srcdir/common)
PHP_ADD_INCLUDE($ext_srcdir/deps)

PHP_ADD_MAKEFILE_FRAGMENT

Expand Down
27 changes: 27 additions & 0 deletions src/Makefile
@@ -0,0 +1,27 @@
CFLAGS = -g -Wall -O0
CC = gcc

TARGET = phptrace
PWD := $(shell pwd)
INCLUDE_FLAG = -I$(PWD)/../common -I$(PWD)/../deps
DEPS_DIR = $(PWD)/../common $(PWD)/../deps/sds
DEPS_FILES = $(foreach d, $(DEPS_DIR), $(wildcard $(d)/*.c))
TRACE_OBJS = $(patsubst %.c, %.o, $(DEPS_FILES))
TRACE_OBJS += cli.o trace.o

all: $(TARGET)

.SUFFIXES: .o .c .h

$(TARGET): $(TRACE_OBJS)
$(CC) $(CFLAGS) $(INCLUDE_FLAG) -o $@ $^ $(LIBS)

$(TRACE_OBJS):%.o:%.c
$(CC) $(CFLAGS) $(INCLUDE_FLAG) -c $< -o $@

clean:
rm -rf $(TARGET)
rm -rf $(TRACE_OBJS)
rm -rf *.o *.so *.a *~

.PHONY: all clean

0 comments on commit 52b8638

Please sign in to comment.