Added the first details
[educational.data.git] / web / makefile
blob8a73c3eeef448ac6ba15d56fcf06c089ac68ac65
1 VPATH=. \
2 studier studier/images \
3 docs docs/images \
4 hobby hobby/images \
5 jscript images
7 top_make_dir:=${shell pwd}
8 build_dir:=${top_make_dir}/.build
9 dirs:=${addprefix ${build_dir}/, ${VPATH}}
10 deps:=\
11 ${wildcard ${addsuffix /*.gen, ${VPATH}}} \
12 ${wildcard ${addsuffix /*.jpg, ${VPATH}}} \
13 ${wildcard ${addsuffix /*.gif, ${VPATH}}} \
14 ${wildcard ${addsuffix /*.css, ${VPATH}}}
15 figdeps:=${wildcard ${addsuffix /*.fig, ${VPATH}}}
17 targ:=${addprefix ${build_dir}/, ${deps:.gen=.html} ${figdeps:.fig=.gif}}
18 browser=
20 .PHONY: help all clean publish checkin ci test testfirefox
22 help:
23 @echo "==================="
24 @echo " Available targets"
25 @echo "==================="
26 @echo " * all:: Builds all pages and images"
27 @echo " * publish:: publish pages to webserver"
28 @echo " * clean:: removes the build from the system"
29 @echo " * test:: Uses konqueror or mozilla to view build"
30 @echo " * test-firefox:: Uses firefox to view build"
31 @echo " * help:: This little help text"
32 @echo ""
33 @echo " If you set the environment var browser=mozilla,"
34 @echo " that browser will be used."
35 @echo ""
36 @echo "To execute call make all"
38 all:${targ}
40 ci checkin: clean
41 cvs ci
42 @echo "************** Be wise!!!"
43 @echo " if you are done now, you should remove"
44 @echo " your checked out catalog to prevent any"
45 @echo " fatal mistakes!!!"
46 @echo "**************"
48 test: ${targ}
49 if [ ! -z "${browser}" ]; then \
50 ${browser} ${build_dir}/index.html; \
51 else \
52 if [ ! -z "`which konqueror`" ]; then \
53 konqueror ${build_dir}/index.html; \
54 else \
55 mozilla ${build_dir}/index.html; \
56 fi; \
57 fi;
59 test-firefox: ${targ}
60 cd ${build_dir};firefox-bin index.html
62 test-mozilla: ${targ}
63 mozilla ${build_dir}/index.html
65 publish:${targ}
66 scp -rpq ${build_dir}/* tobibobi@ftp.mip.sdu.dk:/home/tobibobi/WWWpublic
67 @echo "*************** Be wise!!!"
68 @echo " You have just made a publish of files."
69 @echo " You should make a 'make checkin' to make"
70 @echo " sure that your repository is up to date"
71 @echo " Any work after this point is"
72 @echo ""
73 @echo " UNWISE!!!!"
74 @echo ""
75 @echo "***************"
77 clean:
78 rm -rf ${build_dir}
80 ${dirs}:
81 mkdir -p $@
83 ${build_dir}/%.css:%.css
84 cp $< $@
86 ${build_dir}/%.html:%.gen inc/*.inc ${dirs} makefile
87 cat $< | sed -f inc/compile.sed| sed -f inc/compile.sed| sed -f inc/compile.sed > $@
89 ${build_dir}/%.gif:%.gif ${dirs}
90 cp $< $@
92 ${build_dir}/%.jpg:%.jpg ${dirs}
93 cp $< $@
95 ${build_dir}/%.gif:%.fig ${dirs}
96 fig2dev -L gif $< $@