# $Id: /mirror/trunk/config/gen/makefiles/dynpmc.in 35434 2009-01-11T10:42:49.818630Z fperrad  $

PERL        = @perl@
RM_F        = @rm_f@
LOAD_EXT    = @load_ext@
RUNTIME_DIR = @build_dir@/runtime/parrot/dynext
O           = @o@

# add your dynamic pmcs here
#
# gdbmhash is only built when 'libgdbm.so' is available
#
PMCS = \
  dynlexpad \
  foo \
  rotest \
#IF(has_gdbm):  gdbmhash \
  rational \
#IF(has_crypto):  md2 \
#IF(has_crypto):  md4 \
#IF(has_crypto):  md5 \
#IF(has_crypto):  ripemd160 \
#IF(has_crypto):  sha \
#IF(has_crypto):  sha1 \
#IF(has_crypto):  sha256 \
#IF(has_crypto):  sha512 \
  subproxy

BUILD = $(PERL) @build_dir@/tools/build/dynpmc.pl

# some *.pmc file are generated
GEN_PMC_DEFINITIONS = \
#IF(has_crypto):  md2.pmc \
#IF(has_crypto):  md4.pmc \
#IF(has_crypto):  md5.pmc \
#IF(has_crypto):  ripemd160.pmc \
#IF(has_crypto):  sha.pmc \
#IF(has_crypto):  sha1.pmc \
#IF(has_crypto):  sha256.pmc \
#IF(has_crypto):  sha512.pmc

all :
	@$(BUILD) generate $(PMCS)
	@$(BUILD) compile $(PMCS)
	@$(BUILD) linklibs $(PMCS)
	@$(BUILD) copy --destination=$(RUNTIME_DIR) $(PMCS)

test : all
	cd ../.. && $(PERL) -Ilib t/harness t/dynpmc/*.t

testclean :
	$(RM_F) "../../t/dynpmc/*.pir" "../../t/dynpmc/*.pbc"
	$(RM_F) $(DIGEST)

# win32 import library
# win32 program data base - contains debugging info
# win32 incremental link status files
# win32 exported functions and data items
# win32 export definition files
dynext-clean :
	$(RM_F) "*.lib" "*.pdb" "*.ilk" "*.exp" "*.def" "*.manifest"

clean : testclean dynext-clean
	$(RM_F) "*.c" "pmc_*.h" "*_group.h" "*$(LOAD_EXT)" "*.dump" "lib-*" "*$(O)"

archclean :
	$(RM_F) "*$(LOAD_EXT)" "*$(O)" Makefile

realclean: clean
	$(RM_F) Makefile $(GEN_PMC_DEFINITIONS)

distclean: realclean

svnclean: realclean
