forked from ocsigen/tutorial-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (17 loc) · 742 Bytes
/
Makefile
File metadata and controls
22 lines (17 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
TUTORIAL_VERSION ?= $(error "Specify a version through TUTORIAL_VERSION")
TUTORIAL_DIR ?= /var/www/data/manualwiki/tutorial
VERSION_DIR = $(TUTORIAL_DIR)/$(TUTORIAL_VERSION)
USER = www-data
show-help:
@echo "Usage:\n"\
"TUTORIAL_VERSION=x.y make install\n"\
"The target directory may be passed by TUTORIAL_DIR."
install:
@echo ">> Installing tutorial version $(TUTORIAL_VERSION) to $(TUTORIAL_DIR)"
sudo -u $(USER) rm -rf $(VERSION_DIR)
sudo -u $(USER) mkdir -p $(VERSION_DIR)
sudo -u $(USER) cp -r src $(VERSION_DIR)/
sudo -u $(USER) cp -r files $(VERSION_DIR)/
(cd $(VERSION_DIR)/files; sudo -u $(USER) tar cfvz tutorial.tar.gz tutorial)
set-stable:
(cd $(TUTORIAL_DIR); sudo -u $(USER) ln -sf -T $(TUTORIAL_VERSION) stable)