-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (40 loc) · 1.64 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PELICAN=./pelican/run.py
PELICANOPTS=None
BASEDIR=$(PWD)
INPUTDIR=$(BASEDIR)/src
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelican.conf.py
FTP_HOST=localhost
FTP_USER=anonymous
FTP_TARGET_DIR=/
SSH_HOST=rikulo-blog
SSH_USER=rikuloblog
SSH_TARGET_DIR=/var/www
DROPBOX_DIR=~/Dropbox/Rikulo/blog
help:
@echo 'Makefile for a pelican Web site '
@echo ' '
@echo 'Usage: '
@echo ' make html (re)generate the web site '
@echo ' make clean remove the generated files '
@echo ' ftp_upload upload the web site using FTP '
@echo ' ssh_upload upload the web site using SSH '
@echo ' dropbox_upload upload the web site using Dropbox '
@echo ' '
html: clean $(OUTPUTDIR)/index.html
@echo 'Done'
$(OUTPUTDIR)/%.html:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE)
clean:
rm -fr $(OUTPUTDIR)
mkdir $(OUTPUTDIR)
dropbox_upload: $(OUTPUTDIR)/index.html
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
ssh_upload: $(OUTPUTDIR)/index.html
scp -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
ftp_upload: $(OUTPUTDIR)/index.html
lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUT_DIR)/* $(FTP_TARGET_DIR) ; quit"
github: $(OUTPUTDIR)/index.html
ghp-import $(OUTPUTDIR)
git push origin gh-pages
.PHONY: html help clean ftp_upload ssh_upload dropbox_upload github