# Makefile for OVOPS++ testmodule.

# STATICLIB is used to specify an archive target - that is, the module
# object files are combined into one file with unix 'ar' program. This
# file is then easy to link into the binary in the top level makefile.
# You must write here a name for the archive file, for example libbisup.a.
STATICLIB = 

# STATICBIN is used to specify a static binary target.
STATICBIN = static_test

# DYNBIN is used to specify a dynamically linked binary target.
DYNBIN = dynamic_test

### NOTE: STATICBIN MUST NOT BE SAME AS DYNBIN ###

# INSTALL is used in 'make install'.
INSTALL = install
INSTALLOPTS = -c -m 644

# INSTALLTARGET is directory where binaries are installed in 'make install'.
INSTALLTARGET = /tmp

# SUBDIRS is used to specify all directories (modules) which need
# to be compiled successfully to get all objects needed for
# linking to a binary file. Also used in deepclean and deepdep.
SUBDIRS = 

# OWNSTATICLIBS specifies all library-files (*.a) in subdirs.
OWNSTATICLIBS = 

# OWNDYNOBJS is used to specify all (dynamic) object files (*.o) in subdirs.
# For example: subdir1/*.o
OWNDYNOBJS = 

# OBJS must have all object files (*.o) of your module. It is necessary to
# define this and previous variables _before_ the next step 
# (include Rules.Make), otherwise the makefiles WON'T WORK.
OBJS =	testprimitives.o \
	testconduits.o \
	testtimeouts.o \
	pftest.o

#
# Include a Rules file
#
include $(OPPSRC)/Rules.Make

install : static dynamic
	$(INSTALL) $(INSTALLOPTS) $(STATICBIN) $(DYNBIN) $(INSTALLTARGET)

###
### NOTES:
###
### Uncomment for-lines below if you have SUBDIRS defined.
###
### If you get error messages from make, change variables in rule name
### (four variables below, far left) to name you defined above. Or if
### they are undefined, comment them.
###

# Default 'static' rule for modules. Both STATICBIN and STATICLIB are specified
# so that this same rule would work for both individual rules and top
# level executable. One or the other will be empty, but it doesn't matter.
static : $(STATICBIN) $(STATICLIB)

# Default rule to make an archive target.
#$(STATICLIB) : $(OBJS)
#	$(AR) $(AROPTIONS) $(STATICLIB) $(OBJS)
#	$(RANLIB) $(STATICLIB)
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) static ); done

# Default rule to make own static binary.
static_test : $(OBJS) $(STATICLIB)
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) static ); done
	$(CC) $(CCFLAGS) $(INC_DIRS) -o $(STATICBIN) $(OBJS) $(OPP_LIBS) $(OWNSTATICLIBS) $(ORBLIB) $(NAMELIB) $(EVENTLIB) $(PROPERTYLIB)


# Default 'dynamic' rule for modules. Both DYNTARGET and DYNBIN are specified
# so that this same rule would work for both individual rules and top
# level executable. One or the other will be empty, but it doesn't matter.
# Also OBJS is specified to avoid problems with possible subdirectories.
dynamic : $(DYNBIN) $(DYNLIB) $(OBJS)

# Default rule to make a dynamic library.
#$(DYNLIB) : $(OBJS)
#	$(CC) -shared $(CCFLAGS) -o $(DYNLIB) $(OBJS)
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) dynamic ); done

# Default rule to make own dynamically linked binaries.
dynamic_test : $(OBJS)
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) dynamic ); done
	$(CC) $(CCFLAGS) $(INC_DIRS) -o $(DYNBIN) $(DYN_LIBS) $(OWNDYNOBJS) $(OBJS)

# deepdep makes dependencies in current directory and all SUBDIRS.
deepdep : dep
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) deepdep ); done

# deepclean cleans current directory and all SUBDIRS.
deepclean : clean
#	@for i in $(SUBDIRS); do ( cd $$i && $(MAKE) deepclean ); done


# Dependencies are below. The line next to this is used by makedepend, so
# DO NOT DELETE
