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

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

SUBDIRS	= \
	cmds		\
	functions	\
	locale

LIB_DIRS = \
	cmds		\
	functions	\
	servers

DEST_LIB_DIRS	=	$(LIB_DIRS:%=$(lib_prefix)/%)

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

.PHONY:	default test install clean clean.local distclean

default::	$(SUBDIRS)

language::
		$(MAKE) locale SUBTARGET=$@

install::	$(DEST_LIB_DIRS) $(SUBDIRS)

$(DEST_LIB_DIRS):
		$(INSTALL) -d -o ${openca_user} -g ${openca_group} $@

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

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

distclean::
		#$(RM)
