summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6dccd70a1e4e8f39e3e17dd01d33f9fbbd00d45d (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FIND	= ./scripts/find.py
ALLYAML	= $(shell ${FIND} -all)
PROJECT	= $(subst ./,,$(shell cd ./projects; find -type d))
WIKI    = $(shell ls wiki/*.wiki)
WIKIDIR = html/wiki
HTMLDIR = $(addprefix html/, ${PROJECT})
TEAM	= Core IO MM
MEMBER	= BSP Geert Jacopo Kaneko Kieran Laurent Magnus Marek Morimoto Niklas Shimoda Simon Ulrich Wolfram NoAssignee
STATUS	= New Active Blocked Paused Done Abandoned
NOPARAM	= subindex body index
BSP	= bsp51x bsp41x bsp39x

all: wiki/Chat_log.wiki .git/hooks/pre-commit
	@rm -fr index.html html/index.html html/menu.html
	@make -s ${HTMLDIR} ${WIKIDIR}
	@make -s LISTS="${MEMBER}"  TARGET=finds EXP1=member EXP2=-a loop
	@make -s LISTS="${STATUS}"  TARGET=finds EXP1=status EXP2=-s loop
	@make -s LISTS="${TEAM}"    TARGET=finds EXP1=team   EXP2=-t loop
	@make -s LISTS="${BSP}"     TARGET=finds EXP1=bsp    EXP2="-is -b" loop
	@make -s LISTS="${ALLYAML}" TARGET=file     loop
	@make -s LISTS="${NOPARAM}" TARGET=noparam  loop
	@make -s LISTS="${PROJECT}" TARGET=summary  loop
	@make -s LISTS="${WIKI}"    TARGET=wikis    loop
	@make -s menu
	@make -s html/schedule.html
	@make -s index.html

.git/hooks/pre-commit:
	@ln -sf ../../scripts/pre-commit.sh .git/hooks/pre-commit

wiki/Chat_log.wiki: wiki/Chat_log
	@echo $@
	@./scripts/chatlog.py > $@

scripts/schedule.py: projects/schedule.py
	@echo $@
	@ln -sf ../projects/schedule.py $@

html/schedule.html: projects/schedule.py scripts/schedule.py
	@echo $@
	@./scripts/timesheet.py > $@

index.html:
	@ln -sf html/index.html .

${HTMLDIR} ${WIKIDIR}:
	mkdir -p $@

${HTML}: ${FILES} ./scripts/html_${CMD}.py ./scripts/html_base.py ./scripts/base.py
	echo $@
	./scripts/html_${CMD}.py ${OPTION} ${FILES} > $@
loop:
	for list in ${LISTS}; do\
		make PARAM=$${list} EXP1=${EXP1} EXP2="${EXP2}" ${TARGET};\
	done;

myhtml:
	make CMD=${CMD}	OPTION="${OPTION}"	FILES="${FILES}"	HTML=${HTML} ${HTML}
file:
	make CMD=task				FILES=${PARAM}		HTML=$(subst yaml,html,$(subst projects,html,${PARAM})) myhtml
summary:
	make CMD=summary			FILES=projects/${PARAM} HTML=html/${PARAM}/summary.html myhtml
wikis:
	make CMD=wiki				FILES="${PARAM}"	HTML=$(addprefix html/,$(subst .wiki,.html,${PARAM})) myhtml
noparam:
	make CMD=${PARAM}						HTML=html/${PARAM}.html myhtml
menu:
	make CMD=menu	OPTION="${BSP}"					HTML=html/menu.html myhtml
finds:
	make CMD=${EXP1} OPTION=${PARAM}	FILES="$(shell ${FIND} ${EXP2} ${PARAM})" HTML=html/${PARAM}.html myhtml
clean:
	@rm -fr html
	@rm -fr *.html
	@rm -fr wiki/Chatlog.wiki