Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # This is BSD Makefile
  2. # BSD GNU
  3. # ${.TARGET} $@
  4. # ${.ALLSRC} $^
  5. # ${.IMPSRC} $<
  6. PY = python2.7
  7. DEFS = defs-errno defs-signal defs-sc defs-madv defs-siginfo defs-siginfo1 defs-sa defs-mman defs-fcntl defs-sig
  8. all: Libc.txt ${DEFS} strerrnocase.txt
  9. Libc.txt: Libc.txt.templ ${DEFS} sizeofs
  10. ${PY} ./untempl.py Libc.txt.templ ${.TARGET}
  11. # perl -pe 's/\n/\r\n/' < ${.TARGET}.tmp > ${.TARGET}
  12. # ${PY} ./untempl2.py ${.TARGET}.tmp ${.TARGET}
  13. # rm -f ${.TARGET}.tmp
  14. sizeofs: sizeofs.c
  15. ${CC} -O0 -g -o ${.TARGET} ${.ALLSRC}
  16. defs-errno:
  17. ./dumpdefs.py 2 0 i /usr/include/sys/errno.h > ${.TARGET}
  18. ./dumpdefs.py 2 1 i /usr/include/sys/errno.h >> ${.TARGET}
  19. defs-tftp:
  20. ./dumpdefs.py 2 1 i /usr/include/arpa/tftp.h | grep EACCESS > ${.TARGET}
  21. defs-signal:
  22. ./dumpdefs.py 2 1 i /usr/include/sys/signal.h > ${.TARGET}
  23. ./dumpdefs.py 2 2 i /usr/include/sys/signal.h | grep SIGWINCH >> ${.TARGET}
  24. ./dumpdefs.py 2 2 i /usr/include/sys/signal.h | grep SIGTHR >> ${.TARGET}
  25. defs-sig:
  26. ./dumpdefs.py 2 2 i /usr/include/sys/signal.h | grep SIG_ > ${.TARGET}
  27. defs-sa:
  28. ./dumpdefs.py 2 2 s /usr/include/sys/signal.h | grep " SA_" > ${.TARGET}
  29. ./dumpdefs.py 2 3 s /usr/include/sys/signal.h | grep " SA_" >> ${.TARGET}
  30. defs-mman:
  31. ./dumpdefs.py 2 0 s /usr/include/sys/mman.h | grep " PROT_" > ${.TARGET}
  32. ./dumpdefs.py 2 0 s /usr/include/sys/mman.h | grep " MAP_" >> ${.TARGET}
  33. defs-fcntl:
  34. ./dumpdefs.py 2 2 s /usr/include/fcntl.h | grep -v compat | grep " O_" > ${.TARGET}
  35. ./dumpdefs.py 2 1 s /usr/include/fcntl.h | grep " O_" >> ${.TARGET}
  36. defs-siginfo:
  37. ./dumpdefs.py 2 1 i /usr/include/sys/siginfo.h > ${.TARGET}
  38. ./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h >> ${.TARGET}
  39. defs-sc:
  40. ./dumpdefs.py 2 1 i /usr/include/unistd.h | grep _SC_ > ${.TARGET}
  41. defs-madv:
  42. ./dumpdefs.py 2 0 i /usr/include/sys/mman.h | grep MADV > ${.TARGET}
  43. ./dumpdefs.py 2 1 i /usr/include/sys/mman.h | grep MADV >> ${.TARGET}
  44. defs-siginfo1:
  45. ./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep FPE_ > ${.TARGET}
  46. ./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep ILL_ >> ${.TARGET}
  47. ./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep SEGV_ >> ${.TARGET}
  48. ./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep BUS_ >> ${.TARGET}
  49. dumpstrerrno.c: defs-errno
  50. grep -v ERESTART ${.ALLSRC} | grep -v EJUSTRETURN | ./mkdumpstrerrno.py > ${.TARGET}
  51. strerrnocase.txt: dumpstrerrno
  52. ./dumpstrerrno | ./mkstrerrnocase.py > ${.TARGET}
  53. clean:
  54. rm -f sizeofs ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt