Makefile.am 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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="$(top_srcdir)/mibs:$(top_srcdir)/mibs/iana:$(top_srcdir)/mibs/ietf" ; \
  38. ../src/docsis -e $< $(srcdir)/keyfile $@ | \
  39. sed -n '/^Final content/,$$p' | grep -v "^Final content" > $@.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. diff -u $@.1.txt $@.2.txt ; \
  46. rm -f $@ $@.1.txt $@.2.txt ; \
  47. false ; \
  48. fi
  49. # First, the TESTS are built, then they're run.
  50. # The .sh doesn't really depend on the .cfg, but this type of pattern rule is
  51. # portable, where %-style rules (e.g. %.sh) are a GNU make extension.
  52. .cfg.sh: Makefile
  53. # This test is a hack to avoid encoding docsis20_stresstest.cfg, which will
  54. # fail because it references external CVC files and the docsis program looks
  55. # for them relative to the CWD instead of the directory containing the input
  56. # configuration file.
  57. if [ "`basename $@`" = "docsis20_stresstest.sh" ] && \
  58. [ "$(srcdir)" != "$(builddir)" ] ; then \
  59. echo '#!/bin/sh' > $@ ; \
  60. else \
  61. (echo '#!/bin/sh' ; echo make -s $(@:.sh=.bin)) > $@ ; \
  62. fi
  63. chmod +x $@
  64. TESTS = $(CONFIGS_SCRIPT)
  65. clean-local:
  66. -rm -f $(CONFIGS_BINARY)
  67. -rm -f $(CONFIGS_SCRIPT)
  68. -rm -f $(CONFIGS_IN:.cfg=.bin.1.txt)
  69. -rm -f $(CONFIGS_IN:.cfg=.bin.2.txt)