Makefile 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # Copyright (c) 2013, Intel Corporation.
  4. #
  5. # This program is free software; you can redistribute it and/or modify it
  6. # under the terms and conditions of the GNU General Public License,
  7. # version 2, as published by the Free Software Foundation.
  8. #
  9. # This program is distributed in the hope it will be useful, but WITHOUT
  10. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. # more details.
  13. #
  14. # Authors:
  15. # Todd Brandt <todd.e.brandt@linux.intel.com>
  16. # Prefix to the directories we're installing to
  17. DESTDIR ?=
  18. # Directory definitions. These are default and most probably
  19. # do not need to be changed. Please note that DESTDIR is
  20. # added in front of any of them
  21. BINDIR ?= /usr/bin
  22. MANDIR ?= /usr/share/man
  23. LIBDIR ?= /usr/lib
  24. # Toolchain: what tools do we use, and what options do they need:
  25. INSTALL = /usr/bin/install
  26. INSTALL_DATA = ${INSTALL} -m 644
  27. all:
  28. @echo "Nothing to build"
  29. install : uninstall
  30. $(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph
  31. $(INSTALL) sleepgraph.py $(DESTDIR)$(LIBDIR)/pm-graph
  32. $(INSTALL) bootgraph.py $(DESTDIR)$(LIBDIR)/pm-graph
  33. $(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph/config
  34. $(INSTALL_DATA) config/cgskip.txt $(DESTDIR)$(LIBDIR)/pm-graph/config
  35. $(INSTALL_DATA) config/freeze-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  36. $(INSTALL_DATA) config/freeze.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  37. $(INSTALL_DATA) config/freeze-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  38. $(INSTALL_DATA) config/standby-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  39. $(INSTALL_DATA) config/standby.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  40. $(INSTALL_DATA) config/standby-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  41. $(INSTALL_DATA) config/suspend-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  42. $(INSTALL_DATA) config/suspend.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  43. $(INSTALL_DATA) config/suspend-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  44. $(INSTALL_DATA) config/suspend-x2-proc.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
  45. $(INSTALL) -d $(DESTDIR)$(BINDIR)
  46. ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(BINDIR)/bootgraph
  47. ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(BINDIR)/sleepgraph
  48. $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8
  49. $(INSTALL) bootgraph.8 $(DESTDIR)$(MANDIR)/man8
  50. $(INSTALL) sleepgraph.8 $(DESTDIR)$(MANDIR)/man8
  51. uninstall :
  52. rm -f $(DESTDIR)$(MANDIR)/man8/bootgraph.8
  53. rm -f $(DESTDIR)$(MANDIR)/man8/sleepgraph.8
  54. rm -f $(DESTDIR)$(BINDIR)/bootgraph
  55. rm -f $(DESTDIR)$(BINDIR)/sleepgraph
  56. rm -f $(DESTDIR)$(LIBDIR)/pm-graph/config/*
  57. if [ -d $(DESTDIR)$(LIBDIR)/pm-graph/config ] ; then \
  58. rmdir $(DESTDIR)$(LIBDIR)/pm-graph/config; \
  59. fi;
  60. rm -f $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__/*
  61. if [ -d $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__ ] ; then \
  62. rmdir $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__; \
  63. fi;
  64. rm -f $(DESTDIR)$(LIBDIR)/pm-graph/*
  65. if [ -d $(DESTDIR)$(LIBDIR)/pm-graph ] ; then \
  66. rmdir $(DESTDIR)$(LIBDIR)/pm-graph; \
  67. fi;
  68. help:
  69. @echo 'Building targets:'
  70. @echo ' all - Nothing to build'
  71. @echo ' install - Install the program and create necessary directories'
  72. @echo ' uninstall - Remove installed files and directories'
  73. .PHONY: all install uninstall help