From cab760a1b7912548daf2fa033f11b4ea939a86f3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 14 Jan 2015 15:08:36 -0500 Subject: this was sitting there --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3