annotate Makefile @ 3:2b9244d20ecf

Add awk script to pretty print pwsdump output
author Guido Berhoerster <guido+libpws@berhoerster.name>
date Fri, 03 Apr 2015 14:57:57 +0200
parents 97097b4b6bfb
children dfd3ddbdb201
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
1 #
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
2 # Copyright (C) 2015 Guido Berhoerster <guido+libpws@berhoerster.name>
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
3 #
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
11 #
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
14 #
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
22 #
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
23
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
24 PACKAGE = libpws
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
25 VERSION = 1.0.0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
26 DISTNAME := $(PACKAGE)-$(VERSION)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
27
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
28 # gcc, clang, icc, Sun/Solaris Studio
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
29 CC := $(CC) -std=c99
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
30 COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
31 # gcc, clang, icc
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
32 MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
33 # Sun/Solaris Studio
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
34 #MAKEDEPEND.c = $(CC) -xM1 $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
35 # X makedepend
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
36 #MAKEDEPEND.c = makedepend -f- -Y -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) --
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
37 LINK.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
38 LINK.o = $(CC) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
39 AR := ar
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
40 RANLIB := ranlib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
41 INSTALL := install
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
42 INSTALL.exec := $(INSTALL) -D -m 0755
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
43 INSTALL.lib := $(INSTALL) -D -m 0644
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
44 INSTALL.data := $(INSTALL) -D -m 0644
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
45 PAX := pax
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
46 GZIP := gzip
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
47 SED := sed
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
48 XSLTPROC := xsltproc
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
49 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
50 DOCBOOK5_MANPAGES_FLAGS = --stringparam funcsynopsis.style 'ansi' \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
51 --stringparam man.authors.section.enabled 0 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
52 --stringparam man.copyright.section.enabled 0
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
53 DOCBOOK5_XHTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/xhtml/docbook.xsl
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
54 DOCBOOK5_XHTML_FLAGS = --stringparam funcsynopsis.style 'ansi' \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
55 --stringparam generate.consistent.ids 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
56 --stringparam refentry.generate.name 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
57 --stringparam refentry.generate.title 0 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
58 --stringparam refentry.xref.manvolnum 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
59 --stringparam generate.id.attributes 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
60 --stringparam make.valid.html 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
61 --stringparam make.clean.html 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
62 --stringparam html.cleanup 1 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
63 --stringparam html.longdesc 0 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
64 --stringparam ulink.target '' \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
65 --stringparam docbook.css.source '' \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
66 --stringparam css.decoration 0 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
67 --stringparam default.table.width '100%'
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
68
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
69 define generate-manpage-rule =
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
70 $(addsuffix .%,$(basename $1)): $(addsuffix .%.xml,$(basename $(firstword $1))) docbook-update-source-data.xsl
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
71 $$(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
72 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
73 --stringparam package $$(PACKAGE) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
74 --stringparam version $$(VERSION) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
75 docbook-update-source-data.xsl $$< | \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
76 $$(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
77 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
78 --output $(firstword $1) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
79 $$(DOCBOOK5_MANPAGES_FLAGS) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
80 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
81 -
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
82 $$(SED) 's,^\.HP \\w.*$$$$,.HP 4n,' $$@ >$$(@).tmp && mv $$(@).tmp $$@
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
83 for alias in $(wordlist 2,$(words $1),$1); do \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
84 ln -sf $(notdir $(firstword $1)) $$$$alias; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
85 done
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
86 endef
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
87
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
88 DESTDIR ?=
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
89 prefix ?= /usr/local
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
90 bindir ?= $(prefix)/bin
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
91 libdir ?= $(prefix)/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
92 includedir ?= $(prefix)/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
93 datadir ?= $(prefix)/share
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
94
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
95 OS_NAME := $(shell uname -s)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
96 OS_RELEASE := $(shell uname -r)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
97
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
98 ifeq ($(OS_NAME),Linux)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
99 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
100 HAVE_ENDIAN_H ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
101 HAVE_SYS_ENDIAN_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
102 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
103 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
104 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
105 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
106 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
107 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
108 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
109 else ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
110 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
111 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
112 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
113 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
114 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
115 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
116 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
117 HAVE_READPASSPHRASE_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
118 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
119 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
120 else ifeq ($(OS_NAME),NetBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
121 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
122 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
123 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
124 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
125 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
126 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
127 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
128 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
129 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
130 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
131 else ifeq ($(OS_NAME),OpenBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
132 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
133 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
134 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
135 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
136 HAVE_GETENTROPY ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
137 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
138 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
139 HAVE_READPASSPHRASE_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
140 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
141 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
142 else ifeq ($(OS_NAME),SunOS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
143 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
144 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
145 HAVE_SYS_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
146 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
147 ifeq ($(OS_RELEASE),5.10)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
148 HAVE_ERR_H ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
149 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
150 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
151 HAVE_ERR_H ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
152 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
153 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
154 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
155 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
156 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
157 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
158 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
159 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
160 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
161 HAVE_SYS_ENDIAN_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
162 HAVE_ERR_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
163 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
164 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
165 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
166 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
167 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
168 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
169 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
170
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
171 LIBPWS_OBJS = pws.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
172 pws-file.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
173 pws-record.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
174 pws-field.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
175 pws-random.o
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
176 LIBPWS_LIB = $(PACKAGE).a
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
177 LIBPWS_LIB_MEMBERS = $(LIBPWS_OBJS:%.o=$(LIBPWS_LIB)(%.o))
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
178
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
179 PWSDUMP_BIN = pwsdump
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
180 PWSDUMP_OBJS = pwsdump.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
181
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
182 OBJS = $(LIBPWS_OBJS) $(PWSDUMP_OBJS)
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
183
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
184 LIBPWS_MANPAGES = libpws.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
185
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
186 PWS_INIT_MANPAGES = pws_init.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
187 pws_finalize.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
188 pws_set_alloc_functions.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
189 pws_generate_uuid.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
190
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
191 PWS3_FILE_CREATE_MANPAGES = pws3_file_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
192 pws3_file_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
193 pws3_file_get_error_code.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
194 pws3_file_get_error_message.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
195 pws3_file_read_mem.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
196 pws3_file_read_stream.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
197 pws3_file_write_mem.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
198 pws3_file_write_stream.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
199 pws3_file_set_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
200 pws3_file_get_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
201 pws3_file_remove_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
202 pws3_file_insert_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
203 pws3_file_get_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
204 pws3_file_remove_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
205 pws3_file_first_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
206 pws3_file_last_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
207 pws3_file_next_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
208 pws3_file_prev_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
209 pws3_file_insert_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
210 pws3_file_get_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
211 pws3_file_remove_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
212 pws3_file_first_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
213 pws3_file_last_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
214 pws3_file_next_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
215 pws3_file_prev_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
216 pws3_field_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
217 pws3_field_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
218 pws3_field_is_header.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
219 pws3_field_get_type.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
220 pws3_field_get_data_type.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
221 pws3_field_set_uuid.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
222 pws3_field_set_text.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
223 pws3_field_set_time.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
224 pws3_field_set_uint8.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
225 pws3_field_set_uint16.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
226 pws3_field_set_uint32.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
227 pws3_field_set_bytes.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
228 pws3_field_get_uuid.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
229 pws3_field_get_text.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
230 pws3_field_get_time.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
231 pws3_field_get_uint8.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
232 pws3_field_get_uint16.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
233 pws3_field_get_uint32.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
234 pws3_field_get_bytes.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
235 pws3_record_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
236 pws3_record_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
237 pws3_record_set_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
238 pws3_record_get_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
239 pws3_record_remove_field.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
240
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
241 MANPAGES = $(LIBPWS_MANPAGES) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
242 $(PWS_INIT_MANPAGES) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
243 $(PWS3_FILE_CREATE_MANPAGES)
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
244
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
245 XHTML_DOCUMENTATION = $(addsuffix .xhtml,$(firstword $(LIBPWS_MANPAGES)) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
246 $(firstword $(PWS_INIT_MANPAGES)) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
247 $(firstword $(PWS3_FILE_CREATE_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
248
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
249 .DEFAULT_TARGET = all
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
250
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
251 .PHONY: all clean clobber dist install
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
252
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
253 all: $(PWSDUMP_BIN) $(LIBPWS_LIB) $(MANPAGES)
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
254
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
255 doc: $(MANPAGES) $(XHTML_DOCUMENTATION)
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
256
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
257 XCPPFLAGS = -Iinclude
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
258 ifeq ($(HAVE_ARC4RANDOM),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
259 XCPPFLAGS += -DHAVE_ARC4RANDOM
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
260 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
261 ifeq ($(HAVE_ENDIAN_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
262 XCPPFLAGS += -DHAVE_ENDIAN_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
263 else ifeq ($(HAVE_SYS_ENDIAN_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
264 XCPPFLAGS += -DHAVE_SYS_ENDIAN_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
265 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
266 LIBPWS_OBJS += compat/endian.o
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
267 PWSDUMP_OBJS += compat/endian.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
268 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
269 ifeq ($(HAVE_ERR_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
270 XCPPFLAGS += -DHAVE_ERR_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
271 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
272 PWSDUMP_OBJS += compat/err.o
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
273 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
274 ifeq ($(HAVE_GETENTROPY),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
275 XCPPFLAGS += -DHAVE_GETENTROPY
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
276 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
277 LIBPWS_OBJS += compat/getentropy.o
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
278 endif
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
279 ifeq ($(HAVE_GETLINE),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
280 XCPPFLAGS += -DHAVE_GETLINE
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
281 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
282 PWSDUMP_OBJS += compat/getline.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
283 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
284 ifeq ($(HAVE_READPASSPHRASE_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
285 XCPPFLAGS += -DHAVE_READPASSPHRASE_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
286 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
287 PWSDUMP_OBJS += compat/readpassphrase.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
288 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
289 ifeq ($(HAVE_SETPROGNAME),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
290 XCPPFLAGS += -DHAVE_SETPROGNAME
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
291 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
292 PWSDUMP_OBJS += compat/setprogname.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
293 endif
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
294 ifeq ($(HAVE_SYS_TREE_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
295 XCPPFLAGS += -DHAVE_SYS_TREE_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
296 endif
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
297 ifeq ($(HAVE_VIS_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
298 XCPPFLAGS += -DHAVE_VIS_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
299 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
300 PWSDUMP_OBJS += compat/vis.o compat/unvis.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
301 endif
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
302 ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly OpenBSD),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
303 XCPPFLAGS += -I/usr/local/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
304 XLDFLAGS += -L/usr/local/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
305 else ifeq ($(OS_NAME),NetBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
306 XCPPFLAGS += -I/usr/pkg/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
307 XLDFLAGS += -L/usr/pkg/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
308 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
309 ifeq ($(OS_NAME),SunOS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
310 XCPPFLAGS += -I/usr/xpg4/include -D__EXTENSIONS__
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
311 XLDFLAGS += -L/usr/xpg4/lib -R/usr/xpg4/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
312 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
313 ifeq ($(findstring $(OS_NAME),FreeBSD DragonFly NetBSD OpenBSD),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
314 XCPPFLAGS += -D_XOPEN_SOURCE=600
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
315 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
316
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
317 $(LIBPWS_LIB): $(LIBPWS_LIB_MEMBERS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
318
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
319 $(eval $(call generate-manpage-rule,$(LIBPWS_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
320
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
321 $(eval $(call generate-manpage-rule,$(PWS_INIT_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
322
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
323 $(eval $(call generate-manpage-rule,$(PWS3_FILE_CREATE_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
324
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
325 $(PWSDUMP_BIN): $(PWSDUMP_OBJS) $(LIBPWS_LIB) -lnettle
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
326
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
327 %.o: %.c
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
328 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
329 $(COMPILE.c) -o $@ $<
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
330
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
331 (%): %
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
332 $(AR) $(ARFLAGS) $@ $<
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
333 $(RANLIB) $@
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
334
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
335 %.xhtml: %.xml docbook-update-source-data.xsl
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
336 $(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
337 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
338 --stringparam package $(PACKAGE) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
339 --stringparam version $(VERSION) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
340 docbook-update-source-data.xsl $< | \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
341 $(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
342 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
343 --output $@ \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
344 $(DOCBOOK5_XHTML_FLAGS) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
345 $(DOCBOOK5_XHTML_STYLESHEET) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
346 -
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
347
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
348 install:
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
349 for header in include/*.h; do \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
350 $(INSTALL.data) $${header} \
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
351 "$(DESTDIR)$(includedir)/$${header##*/}"; \
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
352 done
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
353 $(INSTALL.lib) $(LIBPWS_LIB) \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
354 "$(DESTDIR)$(libdir)/$(notdir $(LIBPWS_LIB))"
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
355 for manpage in $(MANPAGES); do \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
356 if [ -L $${manpage} ]; then \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
357 $(INSTALL.link) $${manpage} \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
358 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
359 else \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
360 $(INSTALL.data) $${manpage} \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
361 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
362 fi \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
363 done
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
364
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
365 clean:
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
366 rm -f $(LIBPWS_LIB) $(PWSDUMP_BIN) $(OBJS) $(MANPAGES) \
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
367 $(XHTML_DOCUMENTATION)
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
368
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
369 clobber: clean
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
370 rm -f $(patsubst %.o,%.d,$(OBJS))
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
371
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
372 dist: clobber
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
373 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
374 -s ',^\.$$,,' -s ',\./,$(DISTNAME)/,' . | \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
375 $(GZIP) > $(DISTNAME).tar.gz
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
376
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
377 -include $(patsubst %.o,%.d,$(OBJS))