# Makefile
# --------------------------------------------------------------------

TARGET = Example

all : $(TARGET)

JAVA_FLAGS = -g

CC = gcc

CFLAGS = -I/usr/ucbinclude -I${PVM_ROOT}/include

LDFLAGS = -L${PVM_ROOT}/lib/${PVM_ARCH} -lgpvm3 -lpvm3 -lsocket -lnsl

# --------------------------------------------------------------------
# Put all your source files here.  If you have multiple files, put one
# on each line followed by a '\' characer.
# --------------------------------------------------------------------

SRC = 		\
  Worker.java \
  WorkerMain.java \
  UserMain.java 

CLASSES = $(SRC:.java=.class)

$(TARGET) : $(SRC) $(CLASSES) 

Driver : workerDriver.c
	$(CC) -o workerDriver workerDriver.c

	mv workerDriver $(HOME)/pvm3/bin/$(PVM_ARCH)

clean :
	$(RM) $(CLASSES)

realclean :
	$(RM) $(CLASSES) $(TARGET)

# --------------------------------------------------------------------
# This pattern rule forces the regeneration of the .class files from
# .java files as necessary
# --------------------------------------------------------------------

%.class: %.java
	javac $(COMPILER_FLAGS) $<

# --------------------------------------------------------------------
# This pattern rule forces a new version of any file that's newer in
# the RCS directory to be checked out into the current directory.  Note
# that GNU make does not do this by default, hence this rule.
# --------------------------------------------------------------------

%: RCS/%,v
	co -r $< $@
