#
# Pablo System: SDDFlibrary/Makefile
#
TOP := ..

.PHONY : Makefile $(TOP)/Makefile.defines   # explicitly mark PHONY to save time
include $(TOP)/Makefile.defines		    # Pablo configuration parameters

#
# Default target: all 
#	Composed of subgoals for library and executables
#
.PHONY : all library programs

all:    library programs

library:
	$(MAKE) -C Pablo/Build 

programs:
	$(MAKE) -C SamplePrograms 

#
#	The install target is much more complicated that it would need
#	to be if the DecStations supported some decent install flags 
#	(like -d) and would accept more than one file at a time!  
#
THEFILES := $(notdir $(wildcard Pablo/Includes/*))

.PHONY : install clean

install:  all
	$(MAKEDIRHIER) $(PABLOINCLUDE)
	cd Pablo/Includes;  \
	    $(foreach f, $(THEFILES), install -c -m 644 $f $(PABLOINCLUDE);) 

	$(MAKEDIRHIER) $(PABLOLIB)
	cd Pablo/Build; \
	    install -c -m 644 libPablo.a $(PABLOLIB)
	ranlib $(PABLOLIB)/libPablo.a

	$(MAKE) -C SamplePrograms install

clean:
	(cd Pablo/Build; makeClean)
	$(MAKE) -C SamplePrograms clean
