1# DT PS Tree
2#
3# Douglas Thrift
4#
5# @configure_input@
6
7#  Copyright 2010 Douglas Thrift
8#
9#  Licensed under the Apache License, Version 2.0 (the "License");
10#  you may not use this file except in compliance with the License.
11#  You may obtain a copy of the License at
12#
13#      http://www.apache.org/licenses/LICENSE-2.0
14#
15#  Unless required by applicable law or agreed to in writing, software
16#  distributed under the License is distributed on an "AS IS" BASIS,
17#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18#  See the License for the specific language governing permissions and
19#  limitations under the License.
20
21VPATH := @srcdir@
22
23srcdir := @srcdir@
24top_builddir := @top_builddir@
25
26CPPFLAGS := @CPPFLAGS@ $(filter -DPACKAGE_TARNAME% -DPACKAGE_VERSION% -DHAVE_NCURSES% -DHAVE_TERM% -DHAVE_STRUCT_KINFO_PROC% -DHAVE_DECL_KERN_PROC_PROC% -DHAVE_DECL_KERN_PROC_KTHREAD%,@DEFS@)
27CXX := @CXX@
28CXXFLAGS := @CXXFLAGS@ -Wall -Wno-long-long -Wno-parentheses
29LDFLAGS := @LDFLAGS@
30LDLIBS := @LIBS@
31
32PACKAGE_TARNAME := @PACKAGE_TARNAME@
33PACKAGE_VERSION := @PACKAGE_VERSION@
34TARNAME := $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
35
36INSTALL := @INSTALL@
37INSTALL_PROGRAM := @INSTALL_PROGRAM@
38INSTALL_DATA := @INSTALL_DATA@
39
40HELP2MAN := @HELP2MAN@
41REALPATH := @REALPATH@
42BSDTAR := @BSDTAR@
43
44prefix := @prefix@
45exec_prefix := @exec_prefix@
46bindir := @bindir@
47sbindir := @sbindir@
48libexecdir := @libexecdir@
49datarootdir := @datarootdir@
50datadir := @datadir@
51sysconfdir := @sysconfdir@
52sharedstatedir := @sharedstatedir@
53localstatedir := @localstatedir@
54includedir := @includedir@
55oldincludedir := @oldincludedir@
56docdir := @docdir@
57infodir := @infodir@
58htmldir := @htmldir@
59dvidir := @dvidir@
60pdfdir := @pdfdir@
61psdir := @psdir@
62libdir := @libdir@
63localedir := @localedir@
64mandir := @mandir@
65man1dir := ${mandir}/man1
66
67.PHONY: all man dist install uninstall clean distclean
68
69all: dtpstree
70
71ifneq ($(HELP2MAN),:)
72ifneq ($(REALPATH),:)
73man: $(srcdir)/man1/dtpstree.1
74
75$(srcdir)/man1/%.1: % %.man
76	$(HELP2MAN) -I $(filter %.man,$^) -Nn '$(shell sed -e '$$ s|^// ||p;d' $(srcdir)/$<.cpp)' -o $@ -v -Vs $(shell $(REALPATH) $<)
77endif
78endif
79
80ifneq ($(BSDTAR),:)
81dist: man
82	$(BSDTAR) -cf $(TARNAME).tar.bz2 -js '/^\./$(TARNAME)/' -vX .gitignore --exclude='.git*' .
83	$(BSDTAR) -cf $(TARNAME).tar.xz -Js '/^\./$(TARNAME)/' -vX .gitignore --exclude='.git*' .
84endif
85
86install: all
87	$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
88	$(INSTALL_PROGRAM) -s dtpstree $(DESTDIR)$(bindir)
89	$(INSTALL_DATA) $(srcdir)/man1/dtpstree.1 $(DESTDIR)$(man1dir)
90
91uninstall:
92	rm -f $(DESTDIR)$(bindir)/dtpstree
93	rm -f $(DESTDIR)$(man1dir)/dtpstree.1
94
95clean:
96	rm -f dtpstree $(wildcard *core)
97
98distclean: clean
99	rm -f GNUmakefile config.log config.status makefile
100