# file: src/common/var/Makefile
#
#  2001 OpenCA Group

TOP	= ../../..
include $(TOP)/Makefile.global-vars

SUBDIRS	= \
	crypto	\
	mail

VAR_DIRS = \
	batch			\
	batch/export		\
	batch/export/pkcs12	\
	crypto			\
	crypto/cacerts		\
	crypto/certs		\
	crypto/chain		\
	crypto/crls		\
	crypto/keys		\
	crypto/reqs		\
	db			\
	log			\
	log/enroll		\
	log/download		\
	log/receive		\
	log/upload		\
	mail			\
	mail/crins		\
	mail/default		\
	scep			\
	scep/pending		\
	scep/granted		\
	scep/rejected		\
	scep/newcerts		\
	scep/certs		\
	tmp

DEST_VAR_DIRS	=	$(VAR_DIRS:%=$(var_prefix)/%)

#---- variable settings above, rules below ----

.PHONY:	default test install clean clean.local distclean

default::	$(SUBDIRS)

install::	$(DEST_VAR_DIRS)

$(DEST_VAR_DIRS):
		$(INSTALL) -d -o ${httpd_user} -g ${httpd_group} $@

$(SUBDIRS)::
		cd $@ && $(MAKE) $(SUBTARGET)

test install clean distclean::
		$(MAKE) $(SUBDIRS) SUBTARGET=$@

distclean::
		#$(RM)
