#-------------------------------------------------------------------------
# This file was automatically generated by Automake, and manually modified 
# to make it simpler and cleaner. There are three sections in the file:
# 1) Macros
# 2) Recursive Rules and Suffixes (implicit rules)
# 3) Explicit Rules
#-------------------------------------------------------------------------

#-------------------------------------------------------------------------
#   Section 1) Macros
#-------------------------------------------------------------------------
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@

CONDOR_DIR = @CONDOR_DIR@
CXX = @CXX@
ENABLE_MWINDEPENDENT = @ENABLE_MWINDEPENDENT@
MEASURE_DEFN = @MEASURE_DEFN@
MISC_DEFN = @MISC_DEFN@
MISC_LIB = @MISC_LIB@
MW_LIBDIR = @MW_LIBDIR@
MW_LIBDIR_DEBUG = @MW_LIBDIR_DEBUG@
PVM_ROOT = @PVM_ROOT@
RANLIB = @RANLIB@
INSTALL = @INSTALL@
SOCKET_LIB = @SOCKET_LIB@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
MW_BASICLIB = -lMW -lMWRMComm -lMWutil -lNWS  $(SOCKET_LIB)

mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
AR = ar

DEFS = @DEFS@ -I.
LIBS = @LIBS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
CXXFLAGS = @CXXFLAGS@ -Wall

# To work with Insure, need to "setenv DEBUG_BUILD='insure'" and write/copy a good .psrc file
ifdef DEBUG_BUILD
DEBUG_CHECKER = $(DEBUG_BUILD)
MW_LIBDIR = $(MW_LIBDIR_DEBUG)
endif

CXXCOMPILE = $(DEBUG_CHECKER) $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(DEBUG_CHECKER) $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@

# Subdirectories
SUBDIRS =  

# Make independent?
ifeq ($(ENABLE_MWINDEPENDENT), yes)
LIBRARIES = libMWblackbox_indp.a libMWblackbox.a
else 
LIBRARIES = libMWblackbox.a
endif

# If building without Condor, you need not build the worker executable
EXECUTABLES := 
ifeq ($(CONDOR_DIR), no)
EXECUTABLES := 
else
EXECUTABLES = worker_blackbox_socket
endif


libMWblackbox_a_SOURCES = MWDriver_blackbox.C MWTask_blackbox.C
libMWblackbox_a_OBJECTS = MWDriver_blackbox.o MWTask_blackbox.o

libMWblackbox_indp_a_SOURCES = MWWorker_blackbox.C
libMWblackbox_indp_a_OBJECTS = MWWorker_blackbox.o

worker_blackbox_socket_SOURCES = MWWorker_blackbox.C MWTask_blackbox.C MWWorkerMain_blackbox.C
worker_blackbox_socket_OBJECTS =  MWWorker_blackbox.o MWTask_blackbox.o MWWorkerMain_blackbox.o
worker_blackbox_socket_LDADD = -L$(MW_LIBDIR) $(MW_BASICLIB) -lMWsocketworker
worker_blackbox_socket_DEPENDENCIES =
worker_blackbox_socket_LDFLAGS =



INCLUDES = -I. -I.. -I../RMComm
INCLUDEFILES = MWDriver_blackbox.h MWTask_blackbox.h

#-------------------------------------------------------------------------
#   Section 2) Explicit and Implicit Rules
#-------------------------------------------------------------------------

all: $(LIBRARIES) $(EXECUTABLES)

libMWblackbox.a: $(libMWblackbox_a_OBJECTS)
	-rm -f libMWblackbox.a
	$(AR) cru libMWblackbox.a $(libMWblackbox_a_OBJECTS)
	$(RANLIB) libMWblackbox.a
#	cp libMWblackbox.a $(MW_LIBDIR) 

libMWblackbox_indp.a: $(libMWblackbox_indp_a_OBJECTS)
	-rm -f libMWblackbox_indp.a
	$(AR) cru libMWblackbox_indp.a $(libMWblackbox_indp_a_OBJECTS)
	$(RANLIB) libMWblackbox_indp.a
#	cp libMWblackbox.a $(MW_LIBDIR) 

ifeq ($(ENABLE_MWINDEPENDENT), yes)
libMWblackbox_indp.a: $(libMWblackbox_indp_a_OBJECTS)
	-rm -f libMWblackbox_indp.a
	$(AR) cru libMWblackbox_indp.a $(libMWblackbox_indp_a_OBJECTS)
	$(RANLIB) libMWblackbox_indp.a
# Install should copy lib file, no?
#	cp libMWblackbox.a $(MW_LIBDIR) 
endif

ifeq ($(ENABLE_MWINDEPENDENT), yes)
worker_blackbox_indp: $(worker_blackbox_indp_OBJECTS)
	$(CXXLINK) $(worker_blackbox_indp_LDFLAGS) $(worker_blackbox_indp_OBJECTS) $(worker_blackbox_indp_LDADD) $(LIBS)	
endif

# This just builds your worker executable...
worker_blackbox_socket: $(worker_blackbox_socket_OBJECTS) $(worker_blackbox_socket_DEPENDENCIES)
	@rm -f worker_blackbox_socket
	$(CXXLINK) $(worker_blackbox_socket_LDFLAGS) $(worker_blackbox_socket_OBJECTS) $(worker_blackbox_socket_LDADD) $(LIBS)

# (Probably need better handling of dependencies?)
MWDriver_blackbox.o: MWDriver_blackbox.C MWDriver_blackbox.h MWTask_blackbox.h
	$(CXX) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -o $@

MWTask_blackbox.o: MWTask_blackbox.C MWTask_blackbox.h
	$(CXX) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -o $@

# (Probably need better handling of dependencies?)
MWDriver_blackbox_indp.o: MWDriver_blackbox.C MWDriver_blackbox.h MWTask_blackbox.h
	$(CXX) -c -DINDEPENDENT $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -o $@

MWTask_blackbox_indp.o: MWTask_blackbox.C MWTask_blackbox.h
	$(CXX) -c -DINDEPENDENT $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -o $@


.SUFFIXES: .C .o

.C.o:
	$(CXXCOMPILE) -c $< -o $@

#-------------------------------------------------------------------------
#   Section 3) Recursive Rules: Common
#-------------------------------------------------------------------------
install: $(LIBRARIES)
	$(mkinstalldirs) $(libdir)
	@list='$(LIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    echo "  ${INSTALL} -m 644 $$p $(libdir)/$$p"; \
	    $(INSTALL) -m 644 $$p $(libdir)/$$p; \
	    echo " $(RANLIB) $(libdir)/$$p"; \
	    $(RANLIB) $(libdir)/$$p; \
	  fi; \
	done
	$(mkinstalldirs) $(includedir)
	@list='$(INCLUDEFILES)'; for p in $$list; do \
	  if test -f $$p; then \
	    echo "  ${INSTALL} -m 644 $$p $(includedir)/$$p"; \
	    $(INSTALL) -m 644 $$p $(includedir)/$$p; \
	  fi; \
	done	
	[ "__$(SUBDIRS)" = "__" ] || for subdir in `echo "$(SUBDIRS)"`; do (cd $$subdir && $(MAKE) $@) ; done

check:

clean:
	-rm -f *.o *.a *core *.ii
	[ "__$(SUBDIRS)" = "__" ] || for subdir in `echo "$(SUBDIRS)"`; do (cd $$subdir && $(MAKE) $@) ; done

distclean:
	-rm -f Makefile *.tar *.gz
	-rm -rf .deps
	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
	-rm -f *.o *.a *core *.ii
	[ "__$(SUBDIRS)" = "__" ] || for subdir in `echo "$(SUBDIRS)"`; do (cd $$subdir && $(MAKE) $@) ; done

.PHONY: all check clean distclean install
