# Example Project Makefile
#
# usage: make [BUILDTYPE=[prod|dev]]
#
# This makefile illustrates an example build-web project 
# with a Child project (childproject) which  is combined 
# with this project in a unified output.
#
ifndef BUILD_WEB_DIR
$(error you must set BUILD_WEB_DIR to point to $(PWD) before doing make)
endif

# Variables
#======================================================================
# rules.mak contains the default rules for a Makefile.
#
# note that these variable values can be overridden either on the 
# command line of the make via make VARNAME=value or via the 
# Environment.
include $(BUILD_WEB_DIR)/bin/rules.mak

# Source Web Directory
SRCEWEBDIR         = /example-project-srce

# Child Project
# Note that you must specify for the child project the physical location 
# of the child project directory, the location of the Physical Source directory, 
# the location of the Physical Destination directory and the names of a
# Development and Production versions of the directory mapping hashes for the
# child project. 
CHILDPROJECT_DIR = ../child-project/
CHILDPROJECT_DESTDIR = $(DESTPHYSDIR)/js
CHILDPROJECT_DIRMAP = dirmap-childproject-$(BUILDTYPE).pl

#
# rules
#======================================================================

# If there is no Child Project, 
# remove childproject from this dependencies
all: main childproject

clean: clean-main clean-childproject

# Each project which wishes to be able to be included in other projects
# must define a special Makefile-child make file which will be included
# in the parent project.
include $(CHILDPROJECT_DIR)/Makefile-child

