summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 18 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 31418c9..d27cd56 100644
--- a/Makefile
+++ b/Makefile
@@ -6,13 +6,21 @@ sed 's/[ \t<>]/\n/g #tokenize' '$1'|\
grep href |\
sed -r \
-e "s/'/\"/g #normalize quotes" \
- -e 's@^href="http://([^"]*)"@\1@ #strip href off' \
- -e 's@^/@http://lukeshu.ath.cx/@ #fix docroot' |\
+ -e 's@^href="http://([^"]*)"@\1@ #strip href off ' \
+ -e 's@^/@http://lukeshu.ath.cx/@ #fix docroot ' \
+ |\
grep '^lukeshu\.ath\.cx/1/wordpress' |\
+fgrep -v '/feed/' |\
+fgrep -v '/wp-admin/' |\
+fgrep -v '/wp-content/' |\
+fgrep -v 'wlwmanifest.xml' |\
+fgrep -v 'xmlrpc.php' |\
+fgrep -v 'wp-login.php' |\
sed 's/\#.*//' | sort | uniq
endef
sleep = x=$$RANDOM; let 'x %= 15'; sleep $$((30+$$x))
+download = wget -U '$(ua)' '$(call url,$1)' -O tmp/$$$$ && mkdir -vp $(@D) && mv -v tmp/$$$$ $@
default:
rm -rf mk
@@ -20,11 +28,9 @@ default:
.SECONDARY:
web/%:
- mkdir -p $(@D)
- wget -U '$(ua)' '$(call url,$*)' -O tmp/$$$$ && mv tmp/$$$$ $@; $(sleep)
+ $(call download,$*); $(sleep)
web/%/index.chtml:
- mkdir -p $(@D)
- wget -U '$(ua)' '$(call url,$*/)' -O tmp/$$$$ && mv tmp/$$$$ $@; $(sleep)
+ $(call download,$*/); $(sleep)
dep/%: web/% Makefile
test -f $<
@@ -35,3 +41,9 @@ mk/%: dep/%
mkdir -p $(@D)
touch $@
sed -e 's@.@mk/&@' -e 's@/$$@/index.chtml@' $< |xargs -d '\n' $(MAKE) -k
+
+%.html: %.chtml
+ sed '1,3d' < $< > $@
+
+html:
+ find web -name '*.chtml'|sed 's/chtml$$/html/' |xargs $(MAKE)