php-src/ext/phar/Makefile.frag
Peter Kokot 1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00

51 lines
2.5 KiB
Makefile

$(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re
@(cd $(top_srcdir); \
if test -f ./php_phar.h; then \
$(RE2C) $(RE2C_FLAGS) --no-generation-date -b -o phar_path_check.c phar_path_check.re; \
else \
$(RE2C) $(RE2C_FLAGS) --no-generation-date -b -o ext/phar/phar_path_check.c ext/phar/phar_path_check.re; \
fi)
pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'
PHP_PHARCMD_EXECUTABLE = ` \
if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
if test "x$(PHP_MODULES)" != "x"; then \
$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
for i in bz2 zlib phar; do \
if test -f "$(top_builddir)/modules/$$i.la"; then \
. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
fi; \
done; \
fi; \
else \
$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
fi;`
PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
-@test -d $(builddir)/phar || mkdir $(builddir)/phar
-@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc
$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH)
-@echo "Generating phar.php"
@$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) $(srcdir)/build_precommand.php > $(builddir)/phar.php
$(builddir)/phar.phar: $(builddir)/phar.php $(builddir)/phar/phar.inc $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH)
-@echo "Generating phar.phar"
-@rm -f $(builddir)/phar.phar
-@rm -f $(srcdir)/phar.phar
@$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) $(builddir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x \\.svn -p 0 -s $(srcdir)/phar/phar.php -h sha1 -b "$(PHP_PHARCMD_BANG)" $(srcdir)/phar/
-@chmod +x $(builddir)/phar.phar
install-pharcmd: pharcmd
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
$(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir)
-@rm -f $(INSTALL_ROOT)$(bindir)/phar
$(LN_S) -f phar.phar $(INSTALL_ROOT)$(bindir)/phar
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1
@$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1