OSDN Git Service

add wp_imgswap2.py for new OSDN Magazine
[otptools/otptools.git] / sfmag2wiki / Makefile
1 # Makefile for upload
2
3 TARGET=wiki.txt
4 FETCHDIR=/Users/hylom/otptools/sfmag2wiki/fetch
5 OUTDIR=/Users/hylom/otptools/sfmag2wiki/converted
6 UPLOAD=/Users/hylom/otptools/sfmag2wiki/s2wupload.pl
7 ATTACH=/Users/hylom/otptools/sfmag2wiki/s2wattach.pl
8 CONV=/Users/hylom/otptools/sfmag2wiki/sfmag_html2wiki.py
9 DIRNAME:=$(shell basename $$PWD)
10
11 attachments=$(wildcard *.png *jpg *.gif)
12 targets=wiki.txt.cache $(patsubst %,%.cache, $(attachments))
13
14 test:
15         @pwd
16
17 all:
18         for i in *;do [ -d $$i ] && cd $$i && $(MAKE) upload && cd ..; done
19 #       for i in *;do [ -d $$i ] && cd $$i && $(MAKE) test && cd ..; done
20
21
22 all-all:
23         for i in *;do [ -d $$i ] && cd $$i && $(MAKE) upload && cd ..; done
24
25 upload: $(targets)
26
27 wiki.txt.cache: wiki.txt
28         $(UPLOAD) $<
29         touch $@
30
31 %.jpg.cache: %.jpg
32         $(ATTACH) $<
33         touch $@
34
35 %.png.cache: %.png
36         $(ATTACH) $<
37         touch $@
38
39 %.gif.cache: %.gif
40         $(ATTACH) $<
41         touch $@
42
43 clean-all:
44         for i in *;do [ -d $$i ] && cd $$i && $(MAKE) clean && cd ..; done
45
46 clean:
47         rm -f *.cache
48
49 prep:
50         for i in *;do [ -d $$i ] && ln -sf ../Makefile $$i/Makefile; done
51
52 update:
53         @echo $(CONV) $(FETCHDIR)/$(subst -,/,$(DIRNAME)).body.html $(FETCHDIR) $(OUTDIR)