Makefile.am 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ## Process this file with automake to generate Makefile.in
  2. examplesdir = $(prefix)/share/docsis/examples
  3. CONFIGS_IN = \
  4. docsis1.0_2class_non-rfc2669.cfg \
  5. docsis1.0_2class_rfc2669.cfg \
  6. docsis1.0_basic.cfg \
  7. docsis1.0_basic_bpi.cfg \
  8. docsis1.0_basic_upgrade.cfg \
  9. docsis1.0_example.cfg \
  10. docsis1.0_filters2_oidnum.cfg \
  11. docsis1.0_filters2_oidtext.cfg \
  12. docsis1.0_filters_NmAccess.cfg \
  13. docsis1.0_filters_oidnum.cfg \
  14. docsis1.0_filters_oidtext.cfg \
  15. docsis1.1_classifiers.cfg \
  16. docsis1.1_classifiers2.cfg \
  17. docsis1.1_oss_v3coex.cfg \
  18. docsis1.1_simple.cfg \
  19. docsis1.1_stress_test.cfg \
  20. docsis20.cfg \
  21. docsis20_no_snmp.cfg \
  22. docsis20_stresstest.cfg \
  23. docsis_ipv6.cfg \
  24. packetcable_mta.cfg
  25. CONFIGS_TEXT = $(CONFIGS_IN:.cfg=.txt)
  26. CONFIGS_BINARY = $(CONFIGS_IN:.cfg=.bin)
  27. CONFIGS_SCRIPT = $(CONFIGS_IN:.cfg=.sh)
  28. examples_DATA = \
  29. $(CONFIGS_IN) \
  30. $(CONFIGS_TEXT) \
  31. keyfile \
  32. README.txt
  33. EXTRA_DIST = $(examples_DATA)
  34. ../src/docsis:
  35. (cd ../src ; $(MAKE) docsis)
  36. .cfg.bin: ../src/docsis $(srcdir)/keyfile Makefile
  37. export MIBDIRS="`net-snmp-config --default-mibdirs`:$(top_srcdir)/mibs" ; \
  38. ../src/docsis -e $< $(srcdir)/keyfile $@ | \
  39. sed "1,/^Final content/d" > $@.1.txt ; \
  40. ../src/docsis -d $@ > $@.2.txt ; \
  41. if cmp $@.1.txt $@.2.txt && cmp $(<:.cfg=.txt) $@.2.txt ; then \
  42. rm -f $@.1.txt $@.2.txt ; \
  43. true ; \
  44. else \
  45. rm -f $@ $@.1.txt $@.2.txt ; \
  46. false ; \
  47. fi
  48. # First, the TESTS are built, then they're run.
  49. # The .sh doesn't really depend on the .cfg, but this type of pattern rule is
  50. # portable, where %-style rules (e.g. %.sh) are a GNU make extension.
  51. .cfg.sh: Makefile
  52. # This test is a hack to avoid encoding docsis20_stresstest.cfg, which will
  53. # fail because it references external CVC files and the docsis program looks
  54. # for them relative to the CWD instead of the directory containing the input
  55. # configuration file.
  56. if [ "`basename $@`" = "docsis20_stresstest.sh" ] && \
  57. [ "$(srcdir)" != "$(builddir)" ] ; then \
  58. echo '#!/bin/sh' > $@ ; \
  59. else \
  60. (echo '#!/bin/sh' ; echo make -s $(@:.sh=.bin)) > $@ ; \
  61. fi
  62. chmod +x $@
  63. TESTS = $(CONFIGS_SCRIPT)
  64. clean-local:
  65. -rm -f $(CONFIGS_BINARY)
  66. -rm -f $(CONFIGS_SCRIPT)
  67. -rm -f $(CONFIGS_IN:.cfg=.bin.1.txt)
  68. -rm -f $(CONFIGS_IN:.cfg=.bin.2.txt)