~thomir-deactivatedaccount/sloecode/error-style

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Thomi Richards
  • Date: 2011-01-13 22:17:38 UTC
  • mfrom: (32.1.5 help)
  • Revision ID: thomir@gmail.com-20110113221738-tex9bxnz9nvrnixi
Basic help system in place.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
RM=rm
 
2
# Directory to find help source files:
 
3
HELP_SRC_DIR=help_pages
 
4
HELP_DEST_DIR=sloecode/public/help
 
5
# find all help source files:
 
6
HELP_SRCS=$(shell find $(HELP_SRC_DIR) -name "*.rst")
 
7
# ...and the target files that will be made:
 
8
HELP_TARGETS=$(HELP_SRCS:.rst=.html)
 
9
# and the final destination files:
 
10
HELP_INSTALL_SRC=$(shell find $(HELP_SRC_DIR) -type f \( -name '*.html' -o -name '*.png' \))
 
11
HELP_INSTALL=$(patsubst $(HELP_SRC_DIR)%, $(HELP_DEST_DIR)%, $(HELP_INSTALL_SRC))
 
12
 
2
13
 
3
14
check:
4
15
        nosetests --with-pylons=test.ini
6
17
clean:
7
18
        find . -type f \( -name '*.o' -o -name '*.so' -o -name '*.la' -o \
8
19
            -name '*.lo' -o -name '*.py[co]' -o -name '*.dll' -o \
9
 
            -name '*~' \) \
 
20
            -name '*~' -o -name development.db \) \
10
21
            -print0 | xargs -r0 $(RM)
11
 
        rm development.db
 
22
        $(RM) $(HELP_TARGETS)
 
23
        $(RM) -rf $(HELP_DEST_DIR)
 
24
        
12
25
 
13
26
setup-db: development.db
14
27
 
15
28
development.db:
16
29
        paster setup-app development.ini
17
30
 
18
 
run: development.db
 
31
 
 
32
# Do help file translation:
 
33
$(HELP_TARGETS): %.html: %.rst
 
34
        rst2html $< $@
 
35
 
 
36
# Do help file installation:
 
37
$(HELP_INSTALL): $(HELP_DEST_DIR)/%:$(HELP_SRC_DIR)/%
 
38
        mkdir -p $(@D)
 
39
        cp $< $@
 
40
 
 
41
help: $(HELP_TARGETS) 
 
42
 
 
43
help-install: help $(HELP_INSTALL)
 
44
 
 
45
run: development.db help-install
19
46
        paster serve --reload development.ini
20
47
 
21
 
.phony:
22
 
        check clean setup-db run
 
48
.PHONY:
 
49
        check clean setup-db run help help-install