CMLOGSRC = $(shell pwd)
CMLOGINC = $(CMLOGSRC)/include

DIRS =  $(CMLOGSRC)/C++/SACE-4.0 \
	$(CMLOGSRC)/C++/motif \
	$(CMLOGSRC)/Common \
	$(CMLOGSRC)/Thread \
	$(CMLOGSRC)/data \
	$(CMLOGSRC)/database \
	$(CMLOGSRC)/Server \
	$(CMLOGSRC)/ClientD \
	$(CMLOGSRC)/Client \
	$(CMLOGSRC)/Browser \
	$(CMLOGSRC)/Admin \
	$(CMLOGSRC)/Xui \
	$(CMLOGSRC)/Script


ALLDIRS = $(CMLOGSRC)/C++/SACE-4.0 \
	$(CMLOGSRC)/C++/motif \
	$(CMLOGSRC)/Common \
	$(CMLOGSRC)/Thread \
	$(CMLOGSRC)/data \
	$(CMLOGSRC)/database \
	$(CMLOGSRC)/Server \
	$(CMLOGSRC)/ClientD \
	$(CMLOGSRC)/Client \
	$(CMLOGSRC)/Browser \
	$(CMLOGSRC)/Admin \
	$(CMLOGSRC)/Xui \
	$(CMLOGSRC)/Script \
	$(CMLOGSRC)/Examples \
	$(CMLOGSRC)/CDEV \
	$(CMLOGSRC)/CDEV_Q


BINDIRS = $(CMLOGSRC)/bin
LIBDIRS = $(CMLOGSRC)/lib

all:
	@echo "Type one of the following:"
	@echo "	make hpux		for HP 9.x systems"
	@echo "	make hpux-10		for HP 10.x systems"
	@echo "	make hpux-10-ac++	for HP 10.x systems aC++ compiler"
	@echo "	make hpux-cl		for HP 9.x systems with CenterLine"
	@echo "	make irix5		for SGI running irix5"
	@echo "	make sunos4-gcc		for SunOs 4.x and gcc"
	@echo "	make solaris		for Solaris2.x"	
	@echo "	make solaris-lp64	for Solaris2.x 64bit"	
	@echo "	make solaris-noth	for Solaris2.x without threads"	
	@echo "	make solaris-noth-2.6	for Solaris2.6 without threads"	
	@echo "	make solaris-gcc	for Solaris2.x and gcc"
	@echo "	make ultrix-gcc	for 	ultrix 4.x and gcc"
	@echo "	make aix	for 	IBM AIX 4.x"
	@echo "	make linux	for 	Linux 2.2.x i386"
	@echo "	make linux-th	for 	Linux 2.2.x i386 with pthreads"
	@echo "	make linux-alpha	for 	Linux 2.2.x alpha"
	@echo "	make linux-alpha-th	for 	Linux 2.2.x alpha with pthreads"
	@echo "	make mv162      for     mv162 board running vxworks"
	@echo "	make mv167      for     mv167 board running vxworks"
	@echo "	make niCpu030   for     ni 68030 board running vxworks"
	@echo "	make ppc        for     PowerPc board running vxworks"
	@echo " make pc486      for     PC 486 board running vxworks"
	@echo "	make clean      for     cleanup everything"
	@echo "	make cleanobjs  for     cleanup object code only"

hpux hpux-10 hpux-10-ac++ hpux-cl irix5 sunos4-gcc solaris solaris-lp64 solaris-noth solaris-noth-2.6 solaris-gcc ultrix-gcc aix linux linux-th linux-alpha linux-alpha-th mv162 mv167 niCpu030 ppc pc486: 
	@mkdir -p $(CMLOGINC)
	@mkdir -p $(BINDIRS)
	@mkdir -p $(LIBDIRS)

	@for dir in $(DIRS); \
	do \
		cd $$dir; \
		$(MAKE) $@; \
		cd $(CMLOGSRC); \
	done

cleanobjs:
	@for dir in $(ALLDIRS); \
	do \
		cd $$dir; \
		$(MAKE) clean; \
		cd $(CMLOGSRC); \
	done

clean:
	@for dir in $(ALLDIRS); \
	do \
		cd $$dir; \
		$(MAKE) clean; \
		cd $(CMLOGSRC); \
	done
	@for dir in $(BINDIRS) $(LIBDIRS) $(CMLOGINC); \
	do \
		cd $$dir; \
		rm -rf *; \
		cd $(CMLOGSRC); \
	done
