Commit 0c351f73 authored by Guenter Paul Peters's avatar Guenter Paul Peters
Browse files

git-svn-id: https://svn.math.tu-berlin.de/svn/jtem@83 f5b180c5-49ee-4939-b20e-b6ed35f0f7b7
parent 86398937
......@@ -13,15 +13,14 @@ DOCDIR=doc
#the snippets for the webpage are put here
WEBDIR=web
#the html page to read the wabsnippets of (usually a package.html)
PACKAGEHTML=$(shell find $(SRCDIRS) -name package.html | tail --lines=1)
PACKAGEHTML=$(subst package.html,package-summary.html,$(subst $(firstword $(SRCDIRS)),$(DOCDIR),$(shell find $(firstword $(SRCDIRS)) -name package.html | tail --lines=1)))
#location of the web site, may be empty
SERVER=localhost
SERVER=
#directory of the website on the server, or local if SERVER is empty
SRVDIR=/net/www/pub/jtem/test
#directory for the dependencies
LIBDIR=lib
#url for wget to retrieve the dependencies
DOWNLOADDEPS=http://www.math.tu-berlin.de/jtem/downloads
#a place to put the files that constitute a release
RELEASEDIR=release
......@@ -40,46 +39,64 @@ JAVADOCOPTS= -author -protected -nodeprecated -nodeprecatedlist \
-windowtitle 'de.jtem.$(NAME) package API documentation' \
-header '<a href="http://www.jtem.de/$(NAME)" target="_top">$(NAME)</a> by<br><a href="http://www.jtem.de" target="_top">jTEM</a>' \
-footer '<a href="http://www.jtem.de/$(NAME)" target="_top">$(NAME)</a> by<br><a href="http://www.jtem.de" target="_top">jTEM</a>' \
-bottom '<font size=-1><b><a href="mailto:jtem@math.tu-berlin.de?subject=$(NAME):">jTEM</a>\
</b></font>'
-bottom '<font size=-1><b><a href="mailto:jtem@math.tu-berlin.de?subject=$(NAME):">jTEM</a></b></font>' \
-link http://java.sun.com/javase/6/docs/api/ \
$(foreach d, $(DEPNAMES), -link $(JTEMURL)/$(d)/api)
#things that are removed recursively by the clean target
CLEAN=$(BINDIR) $(DOCDIR) $(WEBDIR) $(DEPS) $(RELEASEDIR) .testscompiled
#jtem site url
JTEMURL=http://www.math.tu-berlin.de/jtem
# -- Everything below should be generic - the same for all jtem projects --
SOURCEFILES=$(shell find $(SRCDIRS) -name '*.java')
TESTSOURCEFILES=$(shell find $(TESTDIR) -name '*.java')
TESTS=$(shell echo $(filter %Test.java Test%.java,$(TESTSOURCEFILES))\
| sed -e 's,$(TESTDIR)/,,g' -e 's/.java//g' -e 'y,/,.,')
DEPS=$(patsubst %,$(LIBDIR)/%.jar, $(shell cat dependencies.txt | grep -v '^\#'))
TESTS=$(shell echo $(TESTSOURCEFILES) \
| sed -n -e '/Test/p' | sed -e 's,$(TESTDIR)/,,g' -e 's/.java//g' -e 'y,/,.,')
DEPNAMES=$(shell cat dependencies.txt | grep -v '^\#')
DEPS=$(patsubst %,$(LIBDIR)/%.jar, $(DEPNAMES))
DOCPACKAGES=$(shell find $(SRCDIRS) -name '*.java' -printf "%h\n" | \
sed -e 'y,/,.,' $(foreach d,$(SRCDIRS), -e 's/$(d)\.//') | sort -u)
DOWNLOADDEPS=$(JTEMURL)/downloads
#copy to SRVDIR
ifeq ($(strip $(SERVER)),)
copy_to_website=cp $(1) $(SRVDIR)/$(2)
else
copy_to_website=scp $(1) $(SERVER):$(SRVDIR)/$(2)
endif
#execute on SERVER
ifeq ($(strip $(SERVER)),)
exec_on_server=$(1)
else
exec_on_server=ssh $(SERVER) $(1)
endif
.PHONY: default
default:
cat README
.PHONY: help
help:
@cat README
#dependencies will only be fetched once a day
.PHONY: updatedeps
#dependencies will only be checked once a day and wget only fetches them,
#if the files are newer on the server
.PHONY: updatedeps $(DEPS)
updatedeps: $(DEPS)
$(DEPS): .lastUpdateDepsMinusADay
.lastUpdateDepsMinusADay: .lastUpdateDeps
.lastUpdateDeps:
$(DEPS):
@if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); fi
@cd $(LIBDIR); wget --timestamping $(subst $(LIBDIR), $(DOWNLOADDEPS), $(DEPS))
@touch .lastUpdateDeps
@touch -t `date --date="-1 day" +%Y%m%d%H%M` .lastUpdateDepsMinusADay
@cd $(LIBDIR); \
touch .lastUpdateDepsCheck; \
if [ ! -f .lastUpdateDepsPlusADay \
-o .lastUpdateDepsPlusADay -ot .lastUpdateDepsCheck \
$(foreach d, $(subst $(LIBDIR)/,,$(DEPS)), -o ! -f $d) ]; \
then wget --timestamping $(subst $(LIBDIR), $(DOWNLOADDEPS), $(DEPS)); \
touch -t `date --date="+1 day" +%Y%m%d%H%M` .lastUpdateDepsPlusADay; \
fi
.PHONY: binaries
binaries: $(BINDIR)
$(BINDIR): $(SOURCEFILES) $(DEPS)
$(BINDIR): $(SOURCEFILES) | $(DEPS)
@if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
javac $(JAVACOPTS) \
-classpath `find $(LIBDIR) -name '*.jar' -printf %p:` \
......@@ -110,7 +127,7 @@ endif
.PHONY: javadoc
javadoc: $(DOCDIR)
$(DOCDIR): $(DEPS) $(shell find $(SRCDIRS))
$(DOCDIR): $(shell find $(SRCDIRS)) | $(DEPS)
@if [ ! -d $(DOCDIR) ]; then mkdir $(DOCDIR); fi
javadoc $(JAVADOCOPTS) \
-d $(DOCDIR) -classpath $(BINDIR):`find $(LIBDIR) -name '*.jar' -printf %p:` \
......@@ -120,14 +137,21 @@ $(DOCDIR): $(DEPS) $(shell find $(SRCDIRS))
.PHONY: web
web: $(WEBDIR)/teaser.html $(WEBDIR)/content.html
for f in $?; do $(call copy_to_website,$$f,$(NAME)/$${f#$(WEBDIR)}); done
$(WEBDIR)/teaser.html:
@for f in $?; do $(call copy_to_website,$$f,$(NAME)/$${f#$(WEBDIR)}); done
@$(call exec_on_server,touch $(SRVDIR)/$(NAME)/index.html)
$(PACKAGEHTML): $(DOCDIR)
$(WEBDIR)/teaser.html: $(PACKAGEHTML)
@if [ ! -d $(WEBDIR) ]; then mkdir $(WEBDIR); fi
@sed -e '0,/teaser start/d;/teaser end/,$$d' $(PACKAGEHTML) > $(WEBDIR)/teaser.html
$(WEBDIR)/content.html:
@chmod g+rw $(WEBDIR)/teaser.html
$(WEBDIR)/content.html: $(PACKAGEHTML)
@if [ ! -d $(WEBDIR) ]; then mkdir $(WEBDIR); fi
@sed -e '0,/<body>/Id; /<\/body>/I,$$d' $(PACKAGEHTML) > $(WEBDIR)/content.html
sed -e '0,/teaser start/d; /START OF BOTTOM NAVBAR/,$$d' \
-e 's,\(\.\./\)\+,$(JTEMURL)/$(NAME)/api/,g' \
$(PACKAGEHTML) > $(WEBDIR)/content.html
@chmod g+rw $(WEBDIR)/content.html
blas.jar: $(BINDIR)
cd $(BINDIR); jar cf ../blas.jar *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment