#
# This the top level makefile for all cross compilation on the Alpha.
# All source will be be built and installed into the directory rsx_bin.
# Jim Bevier - JB Systems 03/27/96
# make everything in all directories

DIRS =	cheaders_source\
	acq_source\
	diag_source\
	rtf_source

# to be processed yet
#	com_source
#	ops_source
#	rad_source

all: 
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -f Makefile ]; then co -q Makefile; fi; \
	  if [ -f Makefile ]; then make -f Makefile all; fi; \
	) done;
	echo World Build: all object builds complete

clean:
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -f Makefile ]; then co -q Makefile; fi; \
	  if [ -f Makefile ]; then make -f Makefile clean; fi; \
	) done;

depend:
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -f Makefile ]; then co -q Makefile; fi; \
	  if [ -f Makefile ]; then make -f Makefile depend; fi; \
	) done;

clobber:
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -f Makefile ]; then co -q Makefile; fi; \
	  if [ -f Makefile ]; then make -f Makefile clobber; fi; \
	) done;
# only delete Makefile if not writable
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -w Makefile ]; then rm -f Makefile; fi; \
	) done;

install: all
	for i in $(DIRS); do ( \
	  echo "......BUILDING IN $$i"; \
	  cd $$i; \
	  if [ ! -f Makefile ]; then co -q Makefile; fi; \
	  if [ -f Makefile ]; then make -f Makefile install; fi; \
	) done;
	echo World Build: all objects installed into /rsx/rsx_bin 

