Skip to content

Commit

Permalink
Simplify generated_lists generation
Browse files Browse the repository at this point in the history
The `generated_lists` file is generated as a helper for build related
Makefile to include a list of *.m4 files prerequisites. When some of
these *.m4 files change, the configure script is regenerated when
buildconf is run. This can be simplified using dynamic environment
variable passed to the Makefile directly so it avoids another file from
being generated in the project root directory and shipping it with the
PHP release or creating a dedicated gitignore rule.

This is portable across all POSIX compatible makes So this patch
includes GNU Make, and everybody elses' make derivative support.
  • Loading branch information
petk committed Apr 16, 2019
1 parent 12ee246 commit b09fa9e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ configure
confdefs.h
conftest*

# Generated by `./buildconf` script as a helper for further build/build2.mk file
/generated_lists

# Generated by configure scripts on all systems
/main/internal_functions.c
/main/internal_functions_cli.c
Expand Down
11 changes: 2 additions & 9 deletions build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ SUBDIRS = Zend TSRM

STAMP = buildmk.stamp

ALWAYS = generated_lists


all: $(STAMP) $(ALWAYS)
all: $(STAMP)
@$(MAKE) -s -f build/build2.mk

generated_lists:
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@

$(STAMP): build/buildcheck.sh
@build/buildcheck.sh $(STAMP)

Expand Down Expand Up @@ -64,4 +57,4 @@ gitclean-work:
fi; \
git clean -X -f -d;

.PHONY: $(ALWAYS) snapshot
.PHONY: snapshot
4 changes: 1 addition & 3 deletions build/build2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# | Author: Sascha Schumann <[email protected]> |
# +----------------------------------------------------------------------+

include generated_lists

config_h_in = main/php_config.h.in

targets = configure $(config_h_in)
Expand All @@ -40,7 +38,7 @@ aclocal.m4: configure.ac acinclude.m4
@echo rebuilding $@
cat acinclude.m4 ./build/libtool.m4 > $@

configure: aclocal.m4 configure.ac $(config_m4_files)
configure: aclocal.m4 configure.ac $(M4_FILES)
@echo rebuilding $@
@rm -f $@
$(PHP_AUTOCONF) -f $(SUPPRESS_WARNINGS)
7 changes: 4 additions & 3 deletions buildconf
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ fi

echo "buildconf: Building configure files"

rm -f generated_lists
# List of *.m4 prerequisites files for the make configure target.
M4_FILES=$(echo TSRM/*.m4 Zend/*.m4 ext/*/config*.m4 sapi/*/config*.m4)

if test "$debug" = "1"; then
$MAKE -s -f build/build.mk SUPPRESS_WARNINGS=""
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES" SUPPRESS_WARNINGS=""
else
$MAKE -s -f build/build.mk
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES"
fi

0 comments on commit b09fa9e

Please sign in to comment.