# This is tested with MKS toolkit version 5.2 on WinNT v.4.0 SP6. I tried
# to avoid any MKS-specific extentions, so I hope it will work with most
# makes (you will have to fix path names).

# This is where the tools are
JAVA=t:/jdk1.3
VISIBROKER=t:/VisiBrokerJava-4.0
RM=t:/mks-5.2/mksnt/rm.exe
ZIP=t:/zip-2.1/zip.exe

.SUFFIXES	: .java .class .idl

.idl.java:
	$(VISIBROKER)/bin/idl2java.exe -VBJjavavm $(JAVA)/bin/java -boa -no_tie $<

.java.class:
	$(JAVA)/bin/javac -classpath .\;$(VISIBROKER)/lib/vbdev.jar\;$(VISIBROKER)/lib/vbjorb.jar\;$(VISIBROKER)/lib/vbjdev.jar $<

# The goal here is to build all programs
all:			EventLogService.class UDPBridge.class TestEventLogService.class pack
EventLogService.class:	Log.class LogCapable.class BlackHole.class
Log.class:		EventLog.class
EventLog.class:		EventLog.java

# Remove all class-files and log-files
clean:
	$(RM) -f \
		*.class			\
		*.log			\
		EventLog.java		\
		EventLogHelper.java	\
		EventLogHolder.java	\
		EventLogOperations.java	\
		EventLogPOA.java	\
		EventLogPOATie.java	\
		_EventLogImplBase.java	\
		_EventLogStub.java

# Pack a distribution archive for the article
pack:	\
		EventLogService.java		\
		UDPBridge.java			\
		TestEventLogService.java	\
		Log.java			\
		LogCapable.java			\
		BlackHole.java			\
		EventLog.idl			\
		Log.pm				\
		Log.pl				\
		st.bat				\
		readme.txt			\
		makefile
	$(ZIP) -u EventLoggingCodeExamples.zip $?
