Print a stack trace of running processes
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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # This file is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 2 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. #
  16. VERSION = $(shell awk 'END { print $$1 }' VERSION)
  17. CFLAGS ?= -Wall -Wextra -g -O2
  18. CPPFLAGS += -DVERSION=\"$(VERSION)\"
  19. # Note: assignments are ignored for variable overriden on command line VAR=value
  20. # so DESTDIR is ignored for overriden variables
  21. PREFIX ?= /usr
  22. BINDIR ?= $(PREFIX)/bin
  23. BINDIR := $(DESTDIR)$(BINDIR)
  24. MANDIR ?= $(PREFIX)/share/man
  25. MANDIR := $(DESTDIR)$(MANDIR)
  26. pstack : pstack.c
  27. $(CC) $(CPPFLAGS) $(CFLAGS) -o pstack $^ $(LDFLAGS)
  28. clean:
  29. rm -f pstack
  30. install : pstack
  31. mkdir -p "$(BINDIR)"
  32. install -m 755 pstack "$(BINDIR)"
  33. mkdir -p "$(MANDIR)/man1"
  34. install -m 644 man1/pstack.1 "$(MANDIR)/man1"
  35. gittag:
  36. git tag -s pstack-$(VERSION)
  37. archive: gittag
  38. @rm -rf /tmp/pstack-$(VERSION).tar.gz
  39. @git archive -o /tmp/pstack-$(VERSION).tar --prefix=pstack-$(VERSION)/ pstack-$(VERSION)
  40. @cd /tmp; gzip -9 pstack-$(VERSION).tar
  41. @cp /tmp/pstack-$(VERSION).tar.gz .
  42. @echo ""
  43. @echo "The final archive is ./pstack-$(VERSION).tar.gz."