-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (25 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SHELL = /bin/sh
SRCDIR ?= $(shell $(PHP) -r 'echo getcwd();')
MARKDOWN ?= perl $(shell which Markdown.pl)
MV ?= mv -f
PHP ?= php
ZIP = zip
ZIPIN = $(addprefix $(notdir $(SRCDIR))/,_pavatar.inc.php _pavatar.plugin.php pavatar-wordpress.php \
locales/messages.pot locales/README.txt $(wildcard locales/*/_global.php) $(wildcard locales/*/LC_MESSAGES/messages.po) \
README.html)
ZIPOUT = $(SRCDIR)/pavatar-$(VERSION).zip
VERSION = $(shell $(PHP) -r 'include "_pavatar.class.php"; echo Pavatar::VERSION;')
in2out = $(PHP) -r "\$$in = file_get_contents('$(1).in'); \$$in = str_replace('@VERSION@', '$(VERSION)', \$$in); \$$fh=fopen('$(1)', 'w');fwrite(\$$fh, \$$in); fclose(\$$fh);"
all: README.html pavatar-wordpress.php
clean:
$(RM) README.html pavatar-wordpress.php
dist zip: all $(ZIPOUT)
@$(MV) $(ZIPOUT) ..
README.html: README.md
$(MARKDOWN) $< > $@
pavatar-wordpress.php: _pavatar.inc.php pavatar-wordpress.php.in
$(call in2out,$@)
$(ZIPOUT):
cd .. && $(ZIP) $(ZIPOUT) $(ZIPIN)
get-version get_version:
@echo $(VERSION)