Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # $OpenBSD: Makefile,v 1.8 2013/12/08 14:46:39 espie Exp $
  2. S= ${.CURDIR}/../..
  3. KFILE= GENERIC
  4. .if exists(conf/GENERIC.MP)
  5. KFILE= GENERIC.MP
  6. .endif
  7. TDIRS= ${_arch} include fpu
  8. TAGS= ${.CURDIR}/tags
  9. NOPROG=
  10. NOMAN=
  11. NOOBJ=
  12. SUBDIR= stand
  13. # config the fattest kernel we can find into a temporary dir
  14. # to create a Makefile. Then use make to pull some variables
  15. # out and push them into the sub-shell to expand the paths,
  16. # and finally run ctags.
  17. tags::
  18. TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \
  19. eval "S=${S}" && \
  20. config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \
  21. eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \
  22. eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \
  23. eval "_machdir=\$S/arch/$${_mach}" && \
  24. eval "_archdir=\$S/arch/$${_arch}" && \
  25. eval "HFILES=\"`find $S \( -path $S/'arch' -o -path $S/stand -o -path $S/lib/libsa -o -path $S'/lib/libkern/arch' \) -prune -o -name '*.h'; find $${_machdir} $${_archdir} $S/lib/libkern/arch/$${_mach} \( -name boot -o -name stand \) -prune -o -name '*.h'`\"" && \
  26. eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \
  27. eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \
  28. eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \
  29. ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \
  30. egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \
  31. sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3 \\1 /^\\2(\\3\\4$$/;" \
  32. >> ${TAGS} && \
  33. sort -o ${TAGS} ${TAGS} && \
  34. rm -rf $${TDIR}
  35. links:
  36. -for i in conf ${TDIRS}; do \
  37. (cd $$i && rm -f tags; ln -s tags tags); done
  38. obj: _SUBDIRUSE
  39. .include <bsd.prog.mk>