#
# cvs:affy/sdk/util/Makefile2 ---
#
# $Id: Makefile,v 1.16 2007/05/21 18:04:19 awilli Exp $
#

# sdk_root has a relative path to the top of the tree.
# Once set, suck in our variables and definitions.
sdk_root:=..
include ${sdk_root}/Makefile.defs

#
$(call sdk_set_lib_name,affyutil)
$(call sdk_set_link_libs,affyutil m)

# Dont get rid of RowFile and TableFile just yet.
# sdk_cpp_lib:=$(filter-out RowFile.cpp TableFile.cpp,$(wildcard *.cpp))

# Append this to a variable which is used when running ${CXX}
sdk_cpp_cflags+=-I${sdk_root}/portability

# These calls define a series of rules used to build executables.
# (files which arent used in the calls will be fed to a default set
# of actions defined in "Makefile2.post".)
$(call sdk_define_exe,dump-guid,dump-guid.cpp)
$(call sdk_define_exe,util-meminfo,util-meminfo.cpp)

# While we could use ${sdk_root} to name the file,
# this allows one of the prior makefiles or calls
# to change the "post" makefile by setting the variable.
include ${sdk_makefile_post}


TEST_MD5SUM_FILES:=test-md5sum.cpp md5sum.cpp md5.cpp
./test-md5sum: md5sum.h ${TEST_MD5SUM_FILES}
	g++ -I.. -O3 -o $@ ${TEST_MD5SUM_FILES}

_test_md5sum: ./test-md5sum
	./test-md5sum

_test_meminfo: ${sdk_output_bin}/util-meminfo
	${sdk_output_bin}/util-meminfo
ifeq ($(findstring -linux,${CPUCOMSYS}),-linux)
	${sdk_output_bin}/util-meminfo ./CPPTest/input/proc-meminfo-24.txt
	${sdk_output_bin}/util-meminfo ./CPPTest/input/proc-meminfo-26.txt
endif
