#
#       Makefile for src
#
#       Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
#

include ../Mkinclude

OBJDIRS		= math1 misc1 grph1 math2 grph2 misc2
ALLDIRS		= math1 misc1 misc2 grph1 env1 math2 grph2 env2

object:
	@for i in $(OBJDIRS) ; do \
	  cd $$i ; \
	  echo "Making object files in $$i/" ; \
	  $(MAKE) object ; \
	  cd .. ; \
	done

library:
	@for i in $(OBJDIRS) ; do \
	  cd $$i ; \
	  echo "Making a library file with $$i/" ; \
	  $(MAKE) library ; \
	  cd .. ; \
	done

ranlib:
	$(RANLIB) $(LDCLLIBFILE)

dbase:
	@cd env1 ; \
	echo "Making database in env1/" ; \
	$(MAKE) ; \
	cd ..

exec:
	@cd env2 ; \
	echo "Making exec files in env2/" ; \
	$(MAKE) ; \
	cd ..

clean: clean.local clean.dir

distclean: clean.local clean.dir

clean.local:
	$(RM) *~

clean.dir:
	@for i in $(ALLDIRS) ; do \
	  cd $$i ; \
	  echo "Cleaning $$i/" ; \
	  $(MAKE) clean ; \
	  cd .. ; \
	done
