Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
2.8 KiB

  1. AM_CPPFLAGS = -I$(top_srcdir)/include
  2. SUBDIRS = include
  3. ACLOCAL_AMFLAGS = -Im4
  4. EXTRA_DIST = VERSION
  5. CLEANFILES = parse.c
  6. sbin_PROGRAMS = ntpd
  7. noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la
  8. dist_man_MANS = ntpctl.8 ntpd.8 ntpd.conf.5
  9. ntpd_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
  10. ntpd_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) libcompat.la libcompatnoopt.la
  11. ntpd_SOURCES = client.c
  12. ntpd_SOURCES += config.c
  13. ntpd_SOURCES += control.c
  14. ntpd_SOURCES += log.c
  15. ntpd_SOURCES += ntp.c
  16. ntpd_SOURCES += ntp.h
  17. ntpd_SOURCES += ntp_dns.c
  18. ntpd_SOURCES += ntp_msg.c
  19. ntpd_SOURCES += ntpd.c
  20. ntpd_SOURCES += ntpd.h
  21. ntpd_SOURCES += parse.y
  22. if !HAVE_ADJFREQ
  23. ntpd_SOURCES += bsd-adjfreq.c
  24. endif
  25. if HAVE_SENSORS
  26. ntpd_SOURCES += sensors.c
  27. else
  28. ntpd_SOURCES += fake-sensors.c
  29. endif
  30. ntpd_SOURCES += server.c
  31. ntpd_SOURCES += util.c
  32. install-exec-hook:
  33. ln -f $(DESTDIR)$(sbindir)/ntpd $(DESTDIR)$(sbindir)/ntpctl
  34. uninstall-local:
  35. -rm -f $(DESTDIR)$(sbindir)/ntpctl
  36. # compatibility functions that need to be built without optimizations
  37. libcompatnoopt_la_CFLAGS = -O0
  38. libcompatnoopt_la_SOURCES =
  39. if !HAVE_EXPLICIT_BZERO
  40. libcompatnoopt_la_SOURCES += compat/explicit_bzero.c
  41. endif
  42. # other compatibility functions
  43. libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
  44. libcompat_la_SOURCES =
  45. libcompat_la_LIBADD = $(PLATFORM_LDADD)
  46. if !HAVE_SETPROCTITLE
  47. libcompat_la_SOURCES += compat/setproctitle.c
  48. endif
  49. if !HAVE_STRLCAT
  50. libcompat_la_SOURCES += compat/strlcat.c
  51. endif
  52. if !HAVE_STRLCPY
  53. libcompat_la_SOURCES += compat/strlcpy.c
  54. endif
  55. if !HAVE_STRNDUP
  56. libcompat_la_SOURCES += compat/strndup.c
  57. # the only user of strnlen is strndup, so only build it if needed
  58. if !HAVE_STRNLEN
  59. libcompat_la_SOURCES += compat/strnlen.c
  60. endif
  61. endif
  62. if !HAVE_STRTONUM
  63. libcompat_la_SOURCES += compat/strtonum.c
  64. endif
  65. if !HAVE_ASPRINTF
  66. libcompat_la_SOURCES += compat/bsd-asprintf.c
  67. endif
  68. if !HAVE_REALLOCARRAY
  69. libcompat_la_SOURCES += compat/reallocarray.c
  70. endif
  71. if !HAVE_MD5
  72. libcompat_la_SOURCES += compat/md5.c
  73. endif
  74. if !HAVE_IMSG
  75. libcompat_la_SOURCES += compat/imsg.c
  76. libcompat_la_SOURCES += compat/imsg-buffer.c
  77. endif
  78. if !HAVE_ARC4RANDOM
  79. libcompat_la_SOURCES += compat/arc4random.c
  80. if !HAVE_GETENTROPY
  81. if HOST_FREEBSD
  82. libcompat_la_SOURCES += compat/getentropy_freebsd.c
  83. endif
  84. if HOST_LINUX
  85. libcompat_la_SOURCES += compat/getentropy_linux.c
  86. ntpd_LDADD += -lcrypto
  87. endif
  88. if HOST_DARWIN
  89. libcompat_la_SOURCES += compat/getentropy_osx.c
  90. ntpd_LDADD += -lcrypto
  91. endif
  92. if HOST_SOLARIS
  93. libcompat_la_SOURCES += compat/getentropy_solaris.c
  94. ntpd_LDADD += -lcrypto
  95. endif
  96. endif
  97. endif
  98. if !HAVE_ARC4RANDOM_UNIFORM
  99. libcompat_la_SOURCES += compat/arc4random_uniform.c
  100. endif
  101. noinst_HEADERS = compat/arc4random.h
  102. noinst_HEADERS += compat/arc4random_freebsd.h
  103. noinst_HEADERS += compat/arc4random_linux.h
  104. noinst_HEADERS += compat/arc4random_osx.h
  105. noinst_HEADERS += compat/arc4random_solaris.h
  106. noinst_HEADERS += compat/arc4random_win.h
  107. noinst_HEADERS += compat/chacha_private.h