#
# FILE:
# src/examples/Makefile - makefile for the webload example files
#
###############################################################################

DIR_ROOT = ../..#                # Set relative path to build root
include ../Make.common

DIR_WL_EXAMP   := $(DIR_ROOT)/export/examples#


dummy      := $(shell mkdir -p $(DIR_WL_EXAMP))#
dummy      :=#

# read-only files
CP_RO := 					\
	README					\
	server-certif.pem

# user-modifiable files.
# note that mykeydb.kdb *must* be writable,
# otherwise skit will refuse to run.
# lets install it wrtable, so that user doesn't have
# to trip over this

CP_RW := 					\
	cleanup.input				\
	http.requests				\
	makecert.sh				\
	passwd					\
	nb.client.input				\
	run.webclient				\
	run.webmon				\
	run.workload				\
	webclient.input				\
	webclient.report			\
	webmon.bat				\
	webmon.out

CP_TRO := $(CP_RO:%=$(DIR_WL_EXAMP)/%)     # add export path to target names
CP_TRW := $(CP_RW:%=$(DIR_WL_EXAMP)/%)     # add export path to target names


.PHONY: all clean 

all:    $(CP_TRO) $(CP_TRW)

# Hmm ... $< seems broken, use $(@F) instead
$(CP_TRO): $(CP_RO)
	$(fancy_line)
	cp -f $(@F) $(DIR_WL_EXAMP)
	chmod ugo+r $(DIR_WL_EXAMP)/$(@F)


$(CP_TRW): $(CP_RW)
	$(fancy_line)
	cp -f $(@F) $(DIR_WL_EXAMP)
	chmod ugo+r $(DIR_WL_EXAMP)/$(@F)
	chmod u+w $(DIR_WL_EXAMP)/$(@F)


clean:
	$(fancy_line)
	$(RM) *.o core tmp junk glop gorp

realclean: clean
	$(RM) $(CP_TRO) $(CP_TRW)

######################### end of file ########################
