Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. obj-y = audit.o common.o condition.o domain.o environ.o file.o gc.o group.o load_policy.o memory.o mount.o network.o realpath.o securityfs_if.o tomoyo.o util.o
  2. $(obj)/policy/profile.conf:
  3. @mkdir -p $(obj)/policy/
  4. @echo Creating an empty policy/profile.conf
  5. @touch $@
  6. $(obj)/policy/exception_policy.conf:
  7. @mkdir -p $(obj)/policy/
  8. @echo Creating a default policy/exception_policy.conf
  9. @echo initialize_domain /sbin/modprobe from any >> $@
  10. @echo initialize_domain /sbin/hotplug from any >> $@
  11. $(obj)/policy/domain_policy.conf:
  12. @mkdir -p $(obj)/policy/
  13. @echo Creating an empty policy/domain_policy.conf
  14. @touch $@
  15. $(obj)/policy/manager.conf:
  16. @mkdir -p $(obj)/policy/
  17. @echo Creating an empty policy/manager.conf
  18. @touch $@
  19. $(obj)/policy/stat.conf:
  20. @mkdir -p $(obj)/policy/
  21. @echo Creating an empty policy/stat.conf
  22. @touch $@
  23. $(obj)/builtin-policy.h: $(obj)/policy/profile.conf $(obj)/policy/exception_policy.conf $(obj)/policy/domain_policy.conf $(obj)/policy/manager.conf $(obj)/policy/stat.conf
  24. @echo Generating built-in policy for TOMOYO 2.5.x.
  25. @echo "static char tomoyo_builtin_profile[] __initdata =" > $@.tmp
  26. @sed -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $(obj)/policy/profile.conf >> $@.tmp
  27. @echo "\"\";" >> $@.tmp
  28. @echo "static char tomoyo_builtin_exception_policy[] __initdata =" >> $@.tmp
  29. @sed -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $(obj)/policy/exception_policy.conf >> $@.tmp
  30. @echo "\"\";" >> $@.tmp
  31. @echo "static char tomoyo_builtin_domain_policy[] __initdata =" >> $@.tmp
  32. @sed -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $(obj)/policy/domain_policy.conf >> $@.tmp
  33. @echo "\"\";" >> $@.tmp
  34. @echo "static char tomoyo_builtin_manager[] __initdata =" >> $@.tmp
  35. @sed -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $(obj)/policy/manager.conf >> $@.tmp
  36. @echo "\"\";" >> $@.tmp
  37. @echo "static char tomoyo_builtin_stat[] __initdata =" >> $@.tmp
  38. @sed -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $(obj)/policy/stat.conf >> $@.tmp
  39. @echo "\"\";" >> $@.tmp
  40. @mv $@.tmp $@
  41. $(obj)/common.o: $(obj)/builtin-policy.h