Mirror of Awesome WM window manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ifeq (,$(VERBOSE))
  2. MAKEFLAGS:=$(MAKEFLAGS)s
  3. ECHO=echo
  4. else
  5. ECHO=@:
  6. endif
  7. BUILDDIR=build
  8. # Run "make" in $(BUILDDIR) by default.
  9. # This is required to generate all files already, which should not be generated
  10. # with "(sudo) make install" only later.
  11. cmake-build: $(BUILDDIR)/Makefile
  12. $(ECHO) "Building…"
  13. $(MAKE) -C $(BUILDDIR)
  14. # Run CMake with CMAKE_ARGS defined on command line ("make CMAKE_ARGS=…").
  15. ifeq ($(origin CMAKE_ARGS),command line)
  16. .PHONY: $(BUILDDIR)/Makefile
  17. endif
  18. $(BUILDDIR)/Makefile:
  19. $(ECHO) "Creating build directory and running cmake in it. You can also run CMake directly, if you want."
  20. $(ECHO)
  21. mkdir -p $(BUILDDIR)
  22. $(ECHO) "Running cmake…"
  23. cd $(BUILDDIR) && cmake $(CMAKE_ARGS) "$(CURDIR)"
  24. tags:
  25. git ls-files | xargs ctags
  26. install:
  27. $(ECHO) "Installing…"
  28. $(MAKE) -C $(BUILDDIR) install
  29. distclean:
  30. $(ECHO) "Cleaning up build directory…"
  31. $(RM) -r $(BUILDDIR)
  32. # Use an explicit rule to not "update" the Makefile via the implicit rule below.
  33. Makefile: ;
  34. %: $(BUILDDIR)/Makefile
  35. $(ECHO) "Running make $@ in $(BUILDDIR)…"
  36. $(MAKE) -C $(BUILDDIR) $@
  37. .PHONY: cmake-build install distclean tags