head	1.1;
access;
symbols
	TIGRIS_1_0_5:1.1
	TIGRIS_1_0:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2000.11.29.13.36.28;	author jrobbins;	state Exp;
branches;
next	;


desc
@@


1.1
log
@initial
@
text
@######################################################################
# -*- Makefile -*- developed for a Unix system.
# 
#  This cooks the templates (if necessary), and copies them into the 
#  installation location.
#

include Makefile.config

# Only do template cooking if USE_COOKED_TEMPLATES is set
#
cook: clean
ifeq (${USE_COOKED_TEMPLATES},true)
	@@mkdir -p $(COOKED_DIR); \
    for RAW in $(RAW_DIRS) ; do \
	    rsync -ar --cvs-exclude --delete $(RAW) $(COOKED_DIR); \
    done; \
    unset RAW;
	perl $(SANDBOX)/scripts/template-cooker -i; \
	find $(COOKED_DIR) -type f -name '*.wm' | xargs perl -pi -e 's,\$$SERVLET_TEMPLATE_ROOT;,$(SERVLET_TEMPLATE_ROOT),g'; \
	$(SANDBOX)/scripts/opersx 'ls *.wm &> /dev/null && $(SANDBOX)/scripts/link-cooker *.wm' '$(COOKED_DIR)'
else
	@@echo "USE_COOKED_TEMPLATES is ${USE_COOKED_TEMPLATES}. Nothing to cook"
endif


clean:
ifeq (${USE_COOKED_TEMPLATES},true)
	- rm -rf $(COOKED_DIR)
endif


install:
	@@mkdir -p --verbose $(INSTALL_DIR); \
	if [ "$(USE_COOKED_TEMPLATES)" = 'true' ]; then \
	  if [ -d $(COOKED_DIR) ]; then \
	    echo 'Copying cooked templates'; \
        for RAW in $(RAW_DIRS) ; do \
	        rsync -ar $(COOKED_DIR)/$$(RAW)/ $(INSTALL_DIR)/$$(RAW); \
        done; \
        unset RAW; \
	  else \
	    echo -n 'Cannot copy cooked templates: '; \
	    echo '$(COOKED_DIR) directory does not exist'; \
	  fi; \
	else \
	  echo 'Copying uncooked templates'; \
      for RAW in $(RAW_DIRS) ; do \
          rsync -ar --cvs-exclude $${RAW}/ $(INSTALL_DIR)/$${RAW}; \
          echo "Cooking links in $(INSTALL_DIR)/$${RAW}"; \
          $(SANDBOX)/scripts/opersx 'ls *.wm &> /dev/null && $(SANDBOX)/scripts/link-cooker *.wm' '$(INSTALL_DIR)/$${RAW}'; \
      done; \
      unset RAW; \
	fi
@
