mirror of
https://github.com/kanaka/mal.git
synced 2024-09-20 10:07:45 +03:00
42f9de6a8a
($ _SERVER) returns a mal hash-map holding the contents of the $_SERVER superglobal from PHP. (! file_get_contents "https://github.com") returns a string containing the github homepage. file_get_contents is a native PHP function.
37 lines
783 B
Makefile
37 lines
783 B
Makefile
|
|
TESTS =
|
|
|
|
SOURCES_BASE = readline.php types.php reader.php printer.php interop.php
|
|
SOURCES_LISP = env.php core.php stepA_mal.php
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
|
|
|
all:
|
|
|
|
dist: mal.php mal
|
|
|
|
mal.php: $(SOURCES)
|
|
cat $+ | grep -v "^require_once" > $@
|
|
|
|
mal: mal.php
|
|
echo "#!/usr/bin/env php" > $@
|
|
cat $< >> $@
|
|
chmod +x $@
|
|
|
|
clean:
|
|
rm -f mal.php mal
|
|
|
|
.PHONY: stats tests $(TESTS)
|
|
|
|
stats: $(SOURCES)
|
|
@wc $^
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*//|^[[:space:]]/\*|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
|
stats-lisp: $(SOURCES_LISP)
|
|
@wc $^
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*//|^[[:space:]]/\*|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
|
|
|
tests: $(TESTS)
|
|
|
|
$(TESTS):
|
|
@echo "Running $@"; \
|
|
php $@ || exit 1; \
|