#
# webCDcreator/Makefile.in
#
# This file is part of webCDwriter - Network CD/DVD Writing.
#
# Copyright (C) 1999-2006 J�rg P. M. Haeger
#
# webCDwriter is free software. See CDcreator.java for details.
#

include ../config

INSTDIR=$(HTTPDIR)/webCDcreator

nosCert=@nosCert@
sunCert=@sunCert@

all: @all@

icons/up.jpg:
	$(MAKE) -C icons

webCDcreator.jar: *.java icons/up.jpg
	javac -target 1.4 *.java
	jar cfm webCDcreator.jar Manifest \
		gpl.html \
		*.class \
		i18n/Messages.properties \
		icons/boot.jpg icons/*.png \
		netscape/security/*.class

test: webCDcreator.jar
	java -jar webCDcreator.jar server=localhost

4netscape: webCDcreator.jar
	rm -rf tmp/
	mkdir tmp/
	cd tmp/ ; jar xf ../webCDcreator.jar
	signtool -k "$(nosCert)" \
		-Z 4netscape/webCDcreator.jar tmp/
	rm -rf tmp/
	$(MAKE) -C 4netscape

4plugin: webCDcreator.jar
	jarsigner -signedjar 4plugin/webCDcreator.jar \
		webCDcreator.jar $(sunCert)
	$(MAKE) -C 4plugin

4pluginRSA: webCDcreator.jar
	rm -rf tmp/
	mkdir tmp/
	cd tmp/ ; jar xf ../webCDcreator.jar
	signtool -k "$(nosCert)" \
		-m manifest.txt \
		-Z 4pluginRSA/webCDcreator.jar tmp/
	rm -rf tmp/
	$(MAKE) -C 4pluginRSA

install: all
	install -d -m 755 $(INSTDIR)/
	cp -pfr doc errors help i18n icons $(INSTDIR)/
	chown -R root.root \
		$(INSTDIR)/{doc,errors,help,i18n,icons} 2> /dev/null \
		|| :
#
# Removed 4pluginRSA*.html and 4pluginIE*.html due
# to conflict with 4plugin*.html
#
# Richard Houser
# rick@divinesymphony.net
#
	$(INSTALL) -m 644 4MJR.html \
		4netscape*.html 4plugin*.html 4WebStart*.html \
		applet*.html object*.html start*.html start*.jnlp \
		welcome*.html \
		$(INSTDIR)/
	$(INSTALL) -m 644 start.html $(INSTDIR)/index.html
	$(MAKE) install -C 4netscape INSTDIR=$(INSTDIR)/4netscape
@4pi@	$(MAKE) install -C 4plugin INSTDIR=$(INSTDIR)/4plugin
	$(MAKE) install -C 4pluginRSA INSTDIR=$(INSTDIR)/4pluginRSA

clean:
	rm -f *~ *.o *.so *.class .nfs* core
	rm -f doc/*~ doc/{de,en,es,nl}/*~
	rm -rf doc/{de,en,es,nl}/.pics/ tmp/
	$(MAKE) -C netscape/security clean
	$(MAKE) -C 4netscape clean
	$(MAKE) -C 4plugin clean
	$(MAKE) -C 4pluginRSA clean
	$(MAKE) -C icons clean

maintainer-clean: clean
	rm -f *.jar *.zip Makefile
	$(MAKE) -C 4netscape maintainer-clean
	$(MAKE) -C 4plugin maintainer-clean
	$(MAKE) -C 4pluginRSA maintainer-clean
	$(MAKE) -C icons maintainer-clean
