os161.baserules.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #
  2. # OS/161 build environment: some very basic rules.
  3. #
  4. # Individual program makefiles should use os161.prog.mk or
  5. # os161.lib.mk instead of including this file directly.
  6. #
  7. # The variable MKDIRS is used to generate rules for creating
  8. # (mostly installation) directories via os161.mkdirs.mk.
  9. # Process this file only once even if included repeatedly
  10. .if !defined(_BASERULES_MK_)
  11. _BASERULES_MK_=# empty
  12. #
  13. # Establish that all these (basic) rules exist.
  14. #
  15. all depend install install-staging clean distclean tags: ;
  16. # distclean implies clean
  17. distclean: clean
  18. .PHONY: all depend install install-staging clean distclean tags
  19. #
  20. # Some other derived rules.
  21. #
  22. # cleandir is the same as distclean (cleandir is the old BSD name)
  23. cleandir: distclean
  24. # "stage" is a good short name for install-staging
  25. stage: install-staging
  26. # dependall means depend then compile
  27. dependall: depend .WAIT all
  28. # build means depend, compile, and install-staging
  29. build: dependall .WAIT install-staging
  30. # rebuild cleans first
  31. rebuild: clean .WAIT build
  32. # fullrebuild does distclean
  33. fullrebuild: distclean .WAIT build
  34. # implement BUILDSYMLINKS
  35. .if "$(BUILDSYMLINKS)" == "yes"
  36. .if !exists(build)
  37. all depend: buildlink
  38. .endif
  39. buildlink:
  40. ln -s $(MYBUILDDIR) build
  41. clean: remove-buildlink
  42. remove-buildlink:
  43. rm -f build
  44. .PHONY: buildlink remove-buildlink
  45. .endif
  46. .PHONY: cleandir stage dependall build rebuild fullrebuild
  47. .endif # _BASERULES_MK_
  48. .include "$(TOP)/mk/os161.mkdirs.mk"
  49. # End.