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.

153 lines
3.3 KiB

  1. AM_CPPFLAGS = -I$(top_srcdir)/include
  2. SUBDIRS = include
  3. ACLOCAL_AMFLAGS = -Im4
  4. EXTRA_DIST = VERSION ntpd.conf
  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_CLOCK_GETRES
  79. libcompat_la_SOURCES += compat/clock_getres.c
  80. endif
  81. if !HAVE_SETRESGID
  82. libcompat_la_SOURCES += compat/bsd-setresgid.c
  83. endif
  84. if !HAVE_SETRESUID
  85. libcompat_la_SOURCES += compat/bsd-setresuid.c
  86. endif
  87. if !HAVE_CLOCK_GETTIME
  88. if HOST_DARWIN
  89. libcompat_la_SOURCES += compat/mach-clock_gettime.c
  90. endif
  91. endif
  92. if !HAVE_ARC4RANDOM
  93. libcompat_la_SOURCES += compat/arc4random.c
  94. if !HAVE_GETENTROPY
  95. if HOST_FREEBSD
  96. libcompat_la_SOURCES += compat/getentropy_freebsd.c
  97. endif
  98. if HOST_LINUX
  99. libcompat_la_SOURCES += compat/getentropy_linux.c
  100. if !HAVE_SHA512
  101. libcompat_la_SOURCES += compat/sha2.c
  102. endif
  103. endif
  104. if HOST_DARWIN
  105. libcompat_la_SOURCES += compat/getentropy_osx.c
  106. if !HAVE_SHA512
  107. libcompat_la_SOURCES += compat/sha2.c
  108. endif
  109. endif
  110. if HOST_SOLARIS
  111. libcompat_la_SOURCES += compat/getentropy_solaris.c
  112. if !HAVE_SHA512
  113. libcompat_la_SOURCES += compat/sha2.c
  114. endif
  115. endif
  116. endif
  117. endif
  118. if !HAVE_ARC4RANDOM_UNIFORM
  119. libcompat_la_SOURCES += compat/arc4random_uniform.c
  120. endif
  121. noinst_HEADERS = compat/arc4random.h
  122. noinst_HEADERS += compat/arc4random_freebsd.h
  123. noinst_HEADERS += compat/arc4random_linux.h
  124. noinst_HEADERS += compat/arc4random_osx.h
  125. noinst_HEADERS += compat/arc4random_solaris.h
  126. noinst_HEADERS += compat/arc4random_win.h
  127. noinst_HEADERS += compat/chacha_private.h