annotate Makefile @ 38:8b55f7b1c6b3

Fix help for ch command
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Thu, 08 Aug 2019 16:23:44 +0200
parents f9501248b6bd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
1 #
6
4269feba381e Ensure everything is built before installing
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 1
diff changeset
2 # Copyright (C) 2017 Guido Berhoerster <guido+pwm@berhoerster.name>
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
3 #
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
11 #
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
14 #
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
22 #
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
23
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
24 PACKAGE = pwm
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
25 VERSION = 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
26 DISTNAME := $(PACKAGE)-$(VERSION)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
27
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
28 # gcc, clang, icc, Sun/Solaris Studio
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
29 CC := $(CC) -std=c99
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
30 COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
31 # gcc, clang, icc
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
32 MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
33 # Sun/Solaris Studio
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
34 #MAKEDEPEND.c = $(CC) -xM1 $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
35 # X makedepend
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
36 #MAKEDEPEND.c = makedepend -f- -Y -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) --
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
37 LINK.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
38 LINK.o = $(CC) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
39 AR := ar
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
40 RANLIB := ranlib
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
41 CP := cp
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
42 INSTALL := install
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
43 INSTALL.exec := $(INSTALL) -D -m 0755
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
44 INSTALL.data := $(INSTALL) -D -m 0644
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
45 INSTALL.link := $(CP) -f -P
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
46 PAX := pax
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
47 GZIP := gzip
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
48 SED := sed
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
49 XSLTPROC := xsltproc
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
50 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
51 DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
52 --stringparam man.copyright.section.enabled 0
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
53
36
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
54 TESTS_OUTPUT_PATH = ./tests/output
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
55
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
56 define generate-manpage-rule =
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
57 $(addsuffix .%,$(basename $1)): $(addsuffix .%.xml,$(basename $(firstword $1))) docbook-update-source-data.xsl
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
58 $$(XSLTPROC) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
59 --xinclude \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
60 --stringparam package $$(PACKAGE) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
61 --stringparam version $$(VERSION) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
62 docbook-update-source-data.xsl $$< | \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
63 $$(XSLTPROC) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
64 --xinclude \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
65 --output $(firstword $1) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
66 $$(DOCBOOK5_MANPAGES_FLAGS) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
67 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
68 -
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
69 for alias in $(wordlist 2,$(words $1),$1); do \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
70 ln -sf $(notdir $(firstword $1)) $$$$alias; \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
71 done
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
72 endef
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
73
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
74 DESTDIR ?=
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
75 prefix ?= /usr/local
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
76 bindir ?= $(prefix)/bin
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
77 datadir ?= $(prefix)/share
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
78 mandir ?= $(datadir)/man
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
79
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
80 OS_NAME := $(shell uname -s)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
81 OS_RELEASE := $(shell uname -r)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
82
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
83 ifeq ($(OS_NAME),Linux)
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
84 HAVE_ARC4RANDOM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
85 HAVE_ASPRINTF ?= 1
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
86 HAVE_CLOSEFROM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
87 HAVE_ERR_H ?= 1
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
88 HAVE_GETLINE ?= 0
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
89 HAVE_GETRANDOM ?= 0
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
90 HAVE_SYS_QUEUE_H ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
91 HAVE_SETPROGNAME ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
92 HAVE_SYS_TREE_H ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
93 else ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly),)
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
94 HAVE_ARC4RANDOM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
95 HAVE_ASPRINTF ?= 1
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
96 HAVE_CLOSEFROM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
97 HAVE_ERR_H ?= 1
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
98 HAVE_GETLINE ?= 1
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
99 HAVE_GETRANDOM ?= 0
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
100 HAVE_SYS_QUEUE_H ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
101 HAVE_SETPROGNAME ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
102 HAVE_SYS_TREE_H ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
103 else ifeq ($(OS_NAME),NetBSD)
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
104 HAVE_ARC4RANDOM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
105 HAVE_ASPRINTF ?= 1
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
106 HAVE_CLOSEFROM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
107 HAVE_ERR_H ?= 1
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
108 HAVE_GETLINE ?= 1
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
109 HAVE_GETRANDOM ?= 0
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
110 HAVE_SYS_QUEUE_H ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
111 HAVE_SYS_TREE_H ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
112 HAVE_SETPROGNAME ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
113 else ifeq ($(OS_NAME),OpenBSD)
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
114 HAVE_ARC4RANDOM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
115 HAVE_ASPRINTF ?= 1
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
116 HAVE_CLOSEFROM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
117 HAVE_ERR_H ?= 1
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
118 HAVE_GETLINE ?= 1
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
119 HAVE_GETRANDOM ?= 0
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
120 HAVE_SYS_QUEUE_H ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
121 HAVE_SYS_TREE_H ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
122 HAVE_SETPROGNAME ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
123 else ifeq ($(OS_NAME),SunOS)
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
124 ifeq ($(OS_RELEASE),5.10)
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
125 HAVE_ARC4RANDOM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
126 HAVE_ASPRINTF ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
127 HAVE_ERR_H ?= 0
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
128 HAVE_GETLINE ?= 0
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
129 HAVE_GETRANDOM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
130 else
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
131 HAVE_ARC4RANDOM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
132 HAVE_ASPRINTF ?= 1
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
133 HAVE_ERR_H ?= 1
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
134 HAVE_GETLINE ?= 1
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
135 HAVE_GETRANDOM ?= 1
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
136 endif
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
137 HAVE_CLOSEFROM ?= 1
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
138 HAVE_SYS_QUEUE_H ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
139 HAVE_SYS_TREE_H ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
140 HAVE_SETPROGNAME ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
141 else
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
142 HAVE_ARC4RANDOM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
143 HAVE_ASPRINTF ?= 0
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
144 HAVE_CLOSEFROM ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
145 HAVE_ERR_H ?= 0
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
146 HAVE_GETLINE ?= 0
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
147 HAVE_GETRANDOM ?= 0
17
a08ef0674d8e Page long output in interactive mode
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 12
diff changeset
148 HAVE_SYS_QUEUE_H ?= 0
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
149 HAVE_SETPROGNAME ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
150 HAVE_SYS_TREE_H ?= 0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
151 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
152
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
153 LIBCOMPAT_OBJS = compat/compat.o
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
154 LIBCOMPAT_LIB = compat/libcompat.a
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
155 LIBCOMPAT_LIB_MEMBERS = $(LIBCOMPAT_OBJS:%.o=$(LIBCOMPAT_LIB)(%.o))
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
156
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
157 LIBPWM_OBJS = util.o
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
158 LIBPWM_LIB = libpwm.a
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
159 LIBPWM_LIB_MEMBERS = $(LIBPWM_OBJS:%.o=$(LIBPWM_LIB)(%.o))
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
160
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
161 PWM_CLIP_OBJS = pwm-clip.o
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
162 PWM_CLIP_BIN = pwm-clip
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
163 PWM_CLIP_MAN1 = pwm-clip.1
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
164
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
165 PWM_OBJS = cmd.o \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
166 io.o \
27
722a45b4028b Add define command for defining macros
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 26
diff changeset
167 macro.o \
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
168 pager.o \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
169 proc.o \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
170 pw.o \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
171 pwfile.o \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
172 pwm.o \
29
00d782cb45fa Read configuration file on startup
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 27
diff changeset
173 pwmrc.o \
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
174 tok.o
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
175 PWM_BIN = $(PACKAGE)
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
176 PWM_MAN1 = pwm.1
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
177
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
178 OBJS = $(LIBCOMPAT_OBJS) $(LIBPWM_OBJS) $(PWM_CLIP_OBJS) $(PWM_OBJS)
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
179
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
180 MANPAGES = $(PWM_MAN1) $(PWM_CLIP_MAN1)
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
181
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
182 .DEFAULT_TARGET = all
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
183
36
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
184 .PHONY: all check clean clobber dist install
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
185
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
186 all: $(PWM_BIN) $(PWM_CLIP_BIN) $(MANPAGES)
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
187
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
188 $(PWM_BIN): XCPPFLAGS += -DPACKAGE=\"$(PACKAGE)\" \
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
189 -DVERSION=\"$(VERSION)\"
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
190 $(PWM_BIN): LDLIBS = -ltecla -lcurses -lpws -lnettle
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
191 $(PWM_CLIP_BIN): XCPPFLAGS += -Icompat/include
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
192 $(PWM_CLIP_BIN): LDLIBS = -lnettle
8
25e227eba3da Fix asprintf compatibility code
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 6
diff changeset
193 ifeq ($(HAVE_ASPRINTF),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
194 XCPPFLAGS += -DHAVE_ASPRINTF
8
25e227eba3da Fix asprintf compatibility code
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 6
diff changeset
195 else
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
196 LIBCOMPAT_OBJS += compat/asprintf.o
8
25e227eba3da Fix asprintf compatibility code
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 6
diff changeset
197 endif
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
198 ifeq ($(HAVE_ARC4RANDOM),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
199 XCPPFLAGS += -DHAVE_ARC4RANDOM
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
200 LIBPWM_OBJS += rand-arc4random.o
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
201 else ifeq ($(HAVE_GETRANDOM),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
202 XCPPFLAGS += -DHAVE_GETRANDOM
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
203 LIBPWM_OBJS += rand-getrandom.o
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
204 else
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
205 LIBPWM_OBJS += rand-dev-random.o
12
8768fbd09bc5 Add generatepassword command to generate random passwords
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 8
diff changeset
206 endif
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
207 ifeq ($(HAVE_CLOSEFROM),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
208 XCPPFLAGS += -DHAVE_CLOSEFROM
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
209 else
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
210 LIBCOMPAT_OBJS += compat/closefrom.o
19
5c6155c8e9b6 Handle signals
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 18
diff changeset
211 endif
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
212 ifeq ($(HAVE_ERR_H),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
213 XCPPFLAGS += -DHAVE_ERR_H
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
214 else
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
215 LIBCOMPAT_OBJS += compat/err.o
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
216 endif
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
217 ifeq ($(HAVE_GETLINE),1)
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
218 XCPPFLAGS += -DHAVE_GETLINE
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
219 else
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
220 LIBCOMPAT_OBJS += compat/getline.o
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
221 endif
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
222 ifeq ($(HAVE_SETPROGNAME),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
223 XCPPFLAGS += -DHAVE_SETPROGNAME
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
224 else
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
225 LIBCOMPAT_OBJS += compat/setprogname.o
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
226 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
227 ifeq ($(HAVE_SYS_TREE_H),1)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
228 XCPPFLAGS += -DHAVE_SYS_TREE_H
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
229 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
230 ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly OpenBSD),)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
231 XCPPFLAGS += -I/usr/local/include
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
232 XLDFLAGS += -L/usr/local/lib
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
233 else ifeq ($(OS_NAME),NetBSD)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
234 XCPPFLAGS += -I/usr/pkg/include
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
235 XLDFLAGS += -L/usr/pkg/lib
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
236 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
237 ifeq ($(findstring $(OS_NAME),FreeBSD DragonFly NetBSD OpenBSD),)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
238 XCPPFLAGS += -D_XOPEN_SOURCE=600
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
239 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
240 ifeq ($(OS_NAME),SunOS)
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
241 XCPPFLAGS += -I/usr/xpg4/include -D__EXTENSIONS__
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
242 XLDFLAGS += -L/usr/xpg4/lib -R/usr/xpg4/lib
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
243 endif
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
244
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
245 $(LIBCOMPAT_LIB): $(LIBCOMPAT_LIB_MEMBERS)
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
246
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
247 $(LIBPWM_LIB): $(LIBPWM_LIB_MEMBERS)
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
248
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
249 $(PWM_CLIP_BIN): $(PWM_CLIP_OBJS) $(LIBPWM_LIB) $(LIBCOMPAT_LIB)
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
250 $(LINK.o) $^ $(LDLIBS) -o $@
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
251
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
252 $(eval $(call generate-manpage-rule,$(PWM_CLIP_MAN1)))
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
253
25
616385fa1fd9 Build common functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 24
diff changeset
254 $(PWM_BIN): $(PWM_OBJS) $(LIBPWM_LIB) $(LIBCOMPAT_LIB)
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
255 $(LINK.o) $^ $(LDLIBS) -o $@
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
256
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
257 $(eval $(call generate-manpage-rule,$(PWM_MAN1)))
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
258
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
259 %.o: %.c
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
260 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
261 $(COMPILE.c) -o $@ $<
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
262
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
263 (%): %
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
264 $(AR) $(ARFLAGS) $@ $<
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
265 $(RANLIB) $@
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
266
6
4269feba381e Ensure everything is built before installing
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 1
diff changeset
267 install: all
24
eb5ce870eb16 Build compatibility functions as a library that can be reused
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 19
diff changeset
268 $(INSTALL.exec) $(PWM_BIN) "$(DESTDIR)$(bindir)/$(PWM_BIN)"
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
269 $(INSTALL.exec) $(PWM_CLIP_BIN) "$(DESTDIR)$(bindir)/$(PWM_CLIP_BIN)"
1
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
270 for manpage in $(MANPAGES); do \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
271 if [ -L $${manpage} ]; then \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
272 $(INSTALL.link) $${manpage} \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
273 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
274 else \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
275 $(INSTALL.data) $${manpage} \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
276 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
277 fi \
55281f14dc9b Add README file and manpage
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 0
diff changeset
278 done
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
279
36
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
280 check: $(PWM_BIN)
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
281 rm -rf $(TESTS_OUTPUT_PATH); \
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
282 SHELL=$(SHELL) PWM=./$(PWM_BIN) \
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
283 TESTS_OUTPUT_PATH=$(TESTS_OUTPUT_PATH) $(SHELL) tests/run-tests.sh
f9501248b6bd Add tests
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 34
diff changeset
284
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
285 clean:
26
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
286 rm -f $(LIBCOMPAT_LIB) $(LIBPWM_LIB) $(PWM_CLIP_BIN) $(PWM_BIN) \
5bdea77d0c1d Add pwm-clip utility for setting the X11 CLIPBOARD selection
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 25
diff changeset
287 $(OBJS) $(MANPAGES)
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
288
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
289 clobber: clean
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
290 rm -f $(patsubst %.o,%.d,$(OBJS))
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
291
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
292 dist: clobber
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
293 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
294 -s ',^\.$$,,' -s ',\./,$(DISTNAME)/,' . | \
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
295 $(GZIP) > $(DISTNAME).tar.gz
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
296
34
34ada71ff3e5 Allow local makefile overrides in local.mk
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 29
diff changeset
297 -include local.mk
34ada71ff3e5 Allow local makefile overrides in local.mk
Guido Berhoerster <guido+pwm@berhoerster.name>
parents: 29
diff changeset
298
0
a7e41e1a79c8 Initial revision
Guido Berhoerster <guido+pwm@berhoerster.name>
parents:
diff changeset
299 -include $(patsubst %.o,%.d,$(OBJS))