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.

156 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_SENSORS
  23. ntpd_SOURCES += sensors.c
  24. else
  25. ntpd_SOURCES += compat/fake-sensors.c
  26. endif
  27. ntpd_SOURCES += server.c
  28. ntpd_SOURCES += util.c
  29. install-exec-hook:
  30. ln -f $(DESTDIR)$(sbindir)/ntpd $(DESTDIR)$(sbindir)/ntpctl
  31. uninstall-local:
  32. -rm -f $(DESTDIR)$(sbindir)/ntpctl
  33. # compatibility functions that need to be built without optimizations
  34. libcompatnoopt_la_CFLAGS = -O0
  35. libcompatnoopt_la_SOURCES =
  36. if !HAVE_EXPLICIT_BZERO
  37. libcompatnoopt_la_SOURCES += compat/explicit_bzero.c
  38. endif
  39. # other compatibility functions
  40. libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
  41. libcompat_la_SOURCES =
  42. libcompat_la_LIBADD = $(PLATFORM_LDADD)
  43. if !HAVE_ADJFREQ
  44. if HOST_FREEBSD
  45. libcompat_la_SOURCES += compat/adjfreq_freebsd.c
  46. endif
  47. if HOST_LINUX
  48. libcompat_la_SOURCES += compat/adjfreq_linux.c
  49. endif
  50. if HOST_DARWIN
  51. libcompat_la_SOURCES += compat/adjfreq_osx.c
  52. endif
  53. if HOST_SOLARIS
  54. libcompat_la_SOURCES += compat/adjfreq_solaris.c
  55. endif
  56. endif
  57. if !HAVE_ASPRINTF
  58. libcompat_la_SOURCES += compat/bsd-asprintf.c
  59. endif
  60. if !HAVE_CLOCK_GETRES
  61. libcompat_la_SOURCES += compat/clock_getres.c
  62. endif
  63. if !HAVE_CLOCK_GETTIME
  64. if HOST_DARWIN
  65. libcompat_la_SOURCES += compat/clock_gettime_osx.c
  66. endif
  67. endif
  68. if !HAVE_IMSG
  69. libcompat_la_SOURCES += compat/imsg.c
  70. libcompat_la_SOURCES += compat/imsg-buffer.c
  71. endif
  72. if !HAVE_MD5
  73. libcompat_la_SOURCES += compat/md5.c
  74. endif
  75. if !HAVE_REALLOCARRAY
  76. libcompat_la_SOURCES += compat/reallocarray.c
  77. endif
  78. if !HAVE_SETPROCTITLE
  79. libcompat_la_SOURCES += compat/setproctitle.c
  80. endif
  81. if !HAVE_STRLCAT
  82. libcompat_la_SOURCES += compat/strlcat.c
  83. endif
  84. if !HAVE_STRLCPY
  85. libcompat_la_SOURCES += compat/strlcpy.c
  86. endif
  87. if !HAVE_STRTONUM
  88. libcompat_la_SOURCES += compat/strtonum.c
  89. endif
  90. if !HAVE_SETRESGID
  91. libcompat_la_SOURCES += compat/bsd-setresgid.c
  92. endif
  93. if !HAVE_SETRESUID
  94. libcompat_la_SOURCES += compat/bsd-setresuid.c
  95. endif
  96. if !HAVE_ARC4RANDOM
  97. libcompat_la_SOURCES += compat/arc4random.c
  98. if !HAVE_GETENTROPY
  99. if HOST_FREEBSD
  100. libcompat_la_SOURCES += compat/getentropy_freebsd.c
  101. endif
  102. if HOST_LINUX
  103. libcompat_la_SOURCES += compat/getentropy_linux.c
  104. if !HAVE_SHA512
  105. libcompat_la_SOURCES += compat/sha2.c
  106. endif
  107. endif
  108. if HOST_DARWIN
  109. libcompat_la_SOURCES += compat/getentropy_osx.c
  110. if !HAVE_SHA512
  111. libcompat_la_SOURCES += compat/sha2.c
  112. endif
  113. endif
  114. if HOST_SOLARIS
  115. libcompat_la_SOURCES += compat/getentropy_solaris.c
  116. if !HAVE_SHA512
  117. libcompat_la_SOURCES += compat/sha2.c
  118. endif
  119. endif
  120. endif
  121. endif
  122. if !HAVE_ARC4RANDOM_UNIFORM
  123. libcompat_la_SOURCES += compat/arc4random_uniform.c
  124. endif
  125. noinst_HEADERS = compat/arc4random.h
  126. noinst_HEADERS += compat/arc4random_freebsd.h
  127. noinst_HEADERS += compat/arc4random_linux.h
  128. noinst_HEADERS += compat/arc4random_osx.h
  129. noinst_HEADERS += compat/arc4random_solaris.h
  130. noinst_HEADERS += compat/arc4random_win.h
  131. noinst_HEADERS += compat/chacha_private.h