# file: $isip/scripts/make/compile.make

# this makefile contains a standard set of dependencies and targets
# that are used by all makefiles in the environment.
#

#------------------------------------------------------------------------------
#
# define variables section
#
#------------------------------------------------------------------------------

HDR_FILES := 
HDR_INST := 

HDR_FILES = $(notdir $(wildcard *.h)) 
HDR_INST = $(foreach hdr,$(HDR_FILES),$(ISIP_PROTO)/include/$(notdir $(hdr)))

# define suffixes
#
.SUFFIXES: .cc

# make sure we clean up
#  note: this code is executed ALL the time
#
.DONE:

# make everything silent
#
.SILENT:

.PHONY: all clean test_make check

#------------------------------------------------------------------------------
#
# define targets and dependencies
#
#------------------------------------------------------------------------------

# define all and install to just to depend
#
all: depend
install: all

# make a link from the class to the $isip/include directory, if necessary
#
$(ISIP_PROTO)/include/%.h: %.h 
	echo "linking" $*".h -> "$(ISIP_PROTO)"/include"
	cp -f `find . -name $*.h -print 2>/dev/null` $(ISIP_PROTO)/include/

# create the $(ISIP_PROTO)/include directory if necessary
#
$(ISIP_PROTO)/include: 
	-if ( test ! -d $(ISIP_PROTO)/include); then mkdir -p $(ISIP_PROTO)/include; fi

# depend directive: this directive is called by recursive make before
# any other, so header files will be in place before any code is
# compiled.
#
depend: $(ISIP_PROTO)/include $(HDR_INST)

# clean does nothing for make depend
#
clean:

test_make:
	echo "hdr_files = " $(HDR_FILES)
	echo "hdr_inst = " $(HDR_INST)

# check existence
#
check: $(HDR_FILES)

#
# end of file

