Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # $OpenBSD: Makefile,v 1.66 2015/07/19 10:44:05 matthieu Exp $
  2. .include <bsd.own.mk>
  3. .include <bsd.xconf.mk>
  4. LOCALAPPD=/usr/local/lib/X11/app-defaults
  5. LOCALAPPX=/usr/local/lib/X11
  6. REALAPPD=/etc/X11/app-defaults
  7. XCONFIG=${XSRCDIR}/etc/X11.${MACHINE}/xorg.conf
  8. RM?=rm
  9. .if ${MACHINE_ARCH} != "vax"
  10. XSERVER= xserver
  11. .endif
  12. .if defined(XENOCARA_BUILD_PIXMAN)
  13. .if ${XENOCARA_BUILD_PIXMAN:L} == "yes" && \
  14. ${XENOCARA_BUILD_GL:L} == "yes" && \
  15. ${XENOCARA_HAVE_SHARED_LIBS:L} == "yes"
  16. XSERVER+= kdrive
  17. .endif
  18. .endif
  19. SUBDIR= proto font/util data/bitmaps lib app data \
  20. ${XSERVER} driver util doc
  21. .ifndef NOFONTS
  22. SUBDIR+= font
  23. .endif
  24. SUBDIR+= distrib/notes
  25. NOOBJ=
  26. .if defined(DESTDIR)
  27. build:
  28. @echo "Cannot run ${MAKE} build with DESTDIR set"
  29. @exit 2
  30. .else
  31. build:
  32. exec ${SUDO} ${MAKE} bootstrap-root
  33. cd util/macros && exec ${MAKE} -f Makefile.bsd-wrapper
  34. exec ${SUDO} ${MAKE} beforebuild
  35. exec ${MAKE} realbuild
  36. exec ${SUDO} ${MAKE} afterbuild
  37. .endif
  38. realbuild: _SUBDIRUSE
  39. # that's all folks
  40. bootstrap:
  41. exec ${SUDO} ${MAKE} bootstrap-root
  42. bootstrap-root:
  43. exec ${MAKE} distrib-dirs
  44. exec ${MAKE} install-mk
  45. beforeinstall beforebuild:
  46. cd util/macros && exec ${MAKE} -f Makefile.bsd-wrapper install
  47. exec ${MAKE} includes
  48. afterinstall afterbuild:
  49. exec ${MAKE} fix-appd
  50. /usr/sbin/makewhatis -Qv ${DESTDIR}/usr/X11R6/man
  51. touch ${DESTDIR}/usr/share/sysmerge/xetcsum
  52. cd ${DESTDIR}/ && \
  53. sort ${.CURDIR}/distrib/sets/lists/xetc/{mi,md.${MACHINE}} | \
  54. xargs sha256 -h ${DESTDIR}/usr/share/sysmerge/xetcsum || true
  55. cd distrib/sets && exec ${MAKE}
  56. install-mk:
  57. cd share/mk && exec ${MAKE} X11BASE=${X11BASE} install
  58. fix-appd:
  59. # Make sure /usr/local/lib/X11/app-defaults is a link
  60. if [ ! -L $(DESTDIR)${LOCALAPPD} ]; then \
  61. if [ -d $(DESTDIR)${LOCALAPPD} ]; then \
  62. mv $(DESTDIR)${LOCALAPPD}/* $(DESTDIR)${REALAPPD} || true; \
  63. rmdir $(DESTDIR)${LOCALAPPD}; \
  64. fi; \
  65. mkdir -p ${DESTDIR}${LOCALAPPX}; \
  66. ln -s ${REALAPPD} ${DESTDIR}${LOCALAPPD}; \
  67. fi
  68. font-cache:
  69. cd font/alias && exec ${MAKE} -f Makefile.bsd-wrapper afterinstall
  70. .if ! ( defined(DESTDIR) && defined(RELEASEDIR) )
  71. release:
  72. @echo You must set DESTDIR and RELEASEDIR for a release.; exit 255
  73. .else
  74. release: sha
  75. sha: release-clean release-install dist hash
  76. hash: dist
  77. -cd ${RELEASEDIR}; \
  78. cksum -a sha256 x*tgz > SHA256
  79. .ORDER: release-clean release-install dist hash
  80. .endif
  81. release-clean:
  82. ${RM} -rf ${DESTDIR}/usr/X11R6/* ${DESTDIR}/usr/X11R6/.[a-zA-Z0-9]*
  83. ${RM} -rf ${DESTDIR}/var/cache/*
  84. ${RM} -rf ${DESTDIR}/etc/X11/*
  85. ${RM} -rf ${DESTDIR}/etc/fonts/*
  86. @if [ -d ${DESTDIR}/usr/X11R6 ] && [ "`cd ${DESTDIR}/usr/X11R6;ls`" ]; then \
  87. echo "Files found in ${DESTDIR}/usr/X11R6:"; \
  88. (cd ${DESTDIR}/usr/X11R6;/bin/pwd;ls -a); \
  89. echo "Cleanup before proceeding."; \
  90. exit 255; \
  91. fi
  92. release-install:
  93. @exec ${MAKE} bootstrap-root
  94. .if ${MACHINE} == zaurus
  95. @if [ -f $(DESTDIR)/etc/X11/xorg.conf ]; then \
  96. echo "Not overwriting existing" $(DESTDIR)/etc/X11/xorg.conf; \
  97. else set -x; \
  98. ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 644 \
  99. ${XCONFIG} ${DESTDIR}/etc/X11 ; \
  100. fi
  101. .endif
  102. @exec ${MAKE} install
  103. dist-rel:
  104. ${MAKE} RELEASEDIR=`pwd`/rel DESTDIR=`pwd`/dest dist 2>&1 | tee distlog
  105. dist:
  106. cd distrib/sets && \
  107. env MACHINE=${MACHINE} ksh ./maketars ${OSrev} ${OSREV} && \
  108. { env MACHINE=${MACHINE} ksh ./checkflist ${OSREV} || true ; }
  109. checkdist:
  110. @cd distrib/sets && \
  111. { env MACHINE=${MACHINE} ksh ./checkflist ${OSREV} || true ; }
  112. distrib-dirs:
  113. .if defined(DESTDIR) && ${DESTDIR} != ""
  114. # running mtree under ${DESTDIR}
  115. mtree -qdef /etc/mtree/BSD.x11.dist -p ${DESTDIR} -U
  116. .else
  117. # running mtree
  118. mtree -qdef /etc/mtree/BSD.x11.dist -p / -U
  119. .endif
  120. .PHONY: all build beforeinstall install afterinstall release clean cleandir \
  121. dist distrib-dirs fix-appd beforebuild bootstrap afterbuild realbuild \
  122. install-mk bootstrap-root
  123. .include <bsd.subdir.mk>
  124. .include <bsd.xorg.mk>