Commit f1e927d9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Some fixes

parent 56f4b611
......@@ -6,5 +6,10 @@ web server.
be included by the Makefile scripts. In that file, you can create a
SUBDIR variable to specify the list of subdirectories.
You can optionnaly define a PHP_FILES variable to specify the list of
files to be preprocessed (without trailing .html/.php). It defaults to
"*.php". Additionnaly, PHP_IGNORE can be used to explicitly exclude
some PHP scripts from static preprocessing.
--
Remi Denis-Courmont
......@@ -18,16 +18,22 @@ all: real-all
include Makefile.inc
ifeq ($(PHP_FILES),)
PHP_FILES := $(wildcard *.html)
ifneq ($(PHP_FILES),)
PHP_FILES := $(PHP_FILES:%=%.php)
else
PHP_FILES := $(wildcard *.php)
endif
ifneq ($(PHP_IGNORES),)
PHP_FILES := $(filter-out $(PHP_IGNORES:%=%.php), $(PHP_FILES))
endif
TARGETS := $(PHP_FILES:%.html=%.tmp)
TARGETS := $(PHP_FILES:%.php=%.html)
real-all: $(TARGETS) all-recursive
clean: clean-recursive
rm -f $(TARGETS)
rm -f $(TARGETS) $(TARGETS:%=%.tmp)
%-recursive:
@for d in $(SUBDIR) ; do \
......@@ -36,9 +42,16 @@ clean: clean-recursive
done
$(TARGETS): %.tmp: %.html $(ROOT)Makefile
%.html: %.php $(ROOT)Makefile
@echo "Preprocessing $@ ..."
@DOCUMENT_ROOT=$(ROOT) $(PHPCGI) $< | $(STRIP_HEADERS) > $@
@rm -f $@.tmp
@if ! DOCUMENT_ROOT=$(ROOT) $(PHPCGI) $< > $@.tmp; then \
cat $@.tmp | tail -1 ; \
exit 1 ; \
fi
@$(STRIP_HEADERS) < $@.tmp > $@
@rm -f $@.tmp
.PHONY: clean all
# Subdirectories to be preprocessed
SUBDIR = doc events removed rez streaming support team vlc
#SUBDIR = doc events removed rez streaming support team vlc
# Files to be preprocessed
#PHP_FILES = # automatic
PHP_IGNORES = mirror
# Additionnal dependencies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment