annotate Makefile @ 10:0feba0fea9d0

Allow local makefile overrides in local.mk
author Guido Berhoerster <guido+libpws@berhoerster.name>
date Wed, 31 Jul 2019 11:21:50 +0200
parents dfd3ddbdb201
children
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
4
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
69 TESTS_OUTPUT_PATH = ./tests/output
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
70
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
71 define generate-manpage-rule =
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
72 $(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
73 $$(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
74 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
75 --stringparam package $$(PACKAGE) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
76 --stringparam version $$(VERSION) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
77 docbook-update-source-data.xsl $$< | \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
78 $$(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
79 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
80 --output $(firstword $1) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
81 $$(DOCBOOK5_MANPAGES_FLAGS) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
82 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
83 -
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
84 $$(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
85 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
86 ln -sf $(notdir $(firstword $1)) $$$$alias; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
87 done
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
88 endef
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
89
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
90 DESTDIR ?=
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
91 prefix ?= /usr/local
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
92 bindir ?= $(prefix)/bin
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
93 libdir ?= $(prefix)/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
94 includedir ?= $(prefix)/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
95 datadir ?= $(prefix)/share
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
96
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
97 OS_NAME := $(shell uname -s)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
98 OS_RELEASE := $(shell uname -r)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
99
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
100 ifeq ($(OS_NAME),Linux)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
101 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
102 HAVE_ENDIAN_H ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
103 HAVE_SYS_ENDIAN_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
104 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
105 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
106 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
107 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
108 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
109 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
110 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
111 else ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
112 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
113 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
114 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
115 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
116 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
117 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
118 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
119 HAVE_READPASSPHRASE_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
120 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
121 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
122 else ifeq ($(OS_NAME),NetBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
123 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
124 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
125 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
126 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
127 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
128 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
129 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
130 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
131 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
132 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
133 else ifeq ($(OS_NAME),OpenBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
134 HAVE_ARC4RANDOM ?= 1
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
135 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
136 HAVE_SYS_ENDIAN_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
137 HAVE_ERR_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
138 HAVE_GETENTROPY ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
139 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
140 HAVE_SETPROGNAME ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
141 HAVE_READPASSPHRASE_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
142 HAVE_SYS_TREE_H ?= 1
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
143 HAVE_VIS_H ?= 1
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
144 else ifeq ($(OS_NAME),SunOS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
145 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
146 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
147 HAVE_SYS_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
148 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
149 ifeq ($(OS_RELEASE),5.10)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
150 HAVE_ERR_H ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
151 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
152 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
153 HAVE_ERR_H ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
154 HAVE_GETLINE ?= 1
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
155 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
156 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
157 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
158 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
159 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
160 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
161 HAVE_ARC4RANDOM ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
162 HAVE_ENDIAN_H ?= 0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
163 HAVE_SYS_ENDIAN_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
164 HAVE_ERR_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
165 HAVE_GETENTROPY ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
166 HAVE_GETLINE ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
167 HAVE_SETPROGNAME ?= 0
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
168 HAVE_READPASSPHRASE_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
169 HAVE_SYS_TREE_H ?= 0
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
170 HAVE_VIS_H ?= 0
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
171 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
172
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
173 LIBPWS_OBJS = pws.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
174 pws-file.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
175 pws-record.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
176 pws-field.o \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
177 pws-random.o
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
178 LIBPWS_LIB = $(PACKAGE).a
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
179 LIBPWS_LIB_MEMBERS = $(LIBPWS_OBJS:%.o=$(LIBPWS_LIB)(%.o))
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
180
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
181 PWSDUMP_BIN = pwsdump
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
182 PWSDUMP_OBJS = pwsdump.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
183
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
184 OBJS = $(LIBPWS_OBJS) $(PWSDUMP_OBJS)
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
185
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
186 LIBPWS_MANPAGES = libpws.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
187
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
188 PWS_INIT_MANPAGES = pws_init.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
189 pws_finalize.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
190 pws_set_alloc_functions.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
191 pws_generate_uuid.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
192
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
193 PWS3_FILE_CREATE_MANPAGES = pws3_file_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
194 pws3_file_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
195 pws3_file_get_error_code.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
196 pws3_file_get_error_message.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
197 pws3_file_read_mem.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
198 pws3_file_read_stream.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
199 pws3_file_write_mem.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
200 pws3_file_write_stream.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
201 pws3_file_set_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
202 pws3_file_get_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
203 pws3_file_remove_header_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
204 pws3_file_insert_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
205 pws3_file_get_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
206 pws3_file_remove_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
207 pws3_file_first_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
208 pws3_file_last_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
209 pws3_file_next_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
210 pws3_file_prev_empty_group.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
211 pws3_file_insert_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
212 pws3_file_get_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
213 pws3_file_remove_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
214 pws3_file_first_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
215 pws3_file_last_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
216 pws3_file_next_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
217 pws3_file_prev_record.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
218 pws3_field_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
219 pws3_field_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
220 pws3_field_is_header.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
221 pws3_field_get_type.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
222 pws3_field_get_data_type.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
223 pws3_field_set_uuid.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
224 pws3_field_set_text.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
225 pws3_field_set_time.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
226 pws3_field_set_uint8.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
227 pws3_field_set_uint16.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
228 pws3_field_set_uint32.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
229 pws3_field_set_bytes.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
230 pws3_field_get_uuid.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
231 pws3_field_get_text.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
232 pws3_field_get_time.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
233 pws3_field_get_uint8.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
234 pws3_field_get_uint16.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
235 pws3_field_get_uint32.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
236 pws3_field_get_bytes.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
237 pws3_record_create.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
238 pws3_record_destroy.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
239 pws3_record_set_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
240 pws3_record_get_field.3 \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
241 pws3_record_remove_field.3
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
242
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
243 MANPAGES = $(LIBPWS_MANPAGES) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
244 $(PWS_INIT_MANPAGES) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
245 $(PWS3_FILE_CREATE_MANPAGES)
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
246
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
247 XHTML_DOCUMENTATION = $(addsuffix .xhtml,$(firstword $(LIBPWS_MANPAGES)) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
248 $(firstword $(PWS_INIT_MANPAGES)) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
249 $(firstword $(PWS3_FILE_CREATE_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
250
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
251 .DEFAULT_TARGET = all
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
252
4
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
253 .PHONY: all clean clobber dist install check
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
254
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
255 all: $(PWSDUMP_BIN) $(LIBPWS_LIB) $(MANPAGES)
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
256
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
257 doc: $(MANPAGES) $(XHTML_DOCUMENTATION)
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
258
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
259 XCPPFLAGS = -Iinclude
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
260 ifeq ($(HAVE_ARC4RANDOM),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
261 XCPPFLAGS += -DHAVE_ARC4RANDOM
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
262 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
263 ifeq ($(HAVE_ENDIAN_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
264 XCPPFLAGS += -DHAVE_ENDIAN_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
265 else ifeq ($(HAVE_SYS_ENDIAN_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
266 XCPPFLAGS += -DHAVE_SYS_ENDIAN_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
267 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
268 LIBPWS_OBJS += compat/endian.o
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
269 PWSDUMP_OBJS += compat/endian.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
270 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
271 ifeq ($(HAVE_ERR_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
272 XCPPFLAGS += -DHAVE_ERR_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
273 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
274 PWSDUMP_OBJS += compat/err.o
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
275 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
276 ifeq ($(HAVE_GETENTROPY),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
277 XCPPFLAGS += -DHAVE_GETENTROPY
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
278 else
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
279 LIBPWS_OBJS += compat/getentropy.o
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
280 endif
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
281 ifeq ($(HAVE_GETLINE),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
282 XCPPFLAGS += -DHAVE_GETLINE
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
283 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
284 PWSDUMP_OBJS += compat/getline.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
285 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
286 ifeq ($(HAVE_READPASSPHRASE_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
287 XCPPFLAGS += -DHAVE_READPASSPHRASE_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
288 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
289 PWSDUMP_OBJS += compat/readpassphrase.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
290 endif
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
291 ifeq ($(HAVE_SETPROGNAME),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
292 XCPPFLAGS += -DHAVE_SETPROGNAME
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
293 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
294 PWSDUMP_OBJS += compat/setprogname.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
295 endif
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
296 ifeq ($(HAVE_SYS_TREE_H),1)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
297 XCPPFLAGS += -DHAVE_SYS_TREE_H
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
298 endif
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
299 ifeq ($(HAVE_VIS_H),1)
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
300 XCPPFLAGS += -DHAVE_VIS_H
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
301 else
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
302 PWSDUMP_OBJS += compat/vis.o compat/unvis.o
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
303 endif
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
304 ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly OpenBSD),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
305 XCPPFLAGS += -I/usr/local/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
306 XLDFLAGS += -L/usr/local/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
307 else ifeq ($(OS_NAME),NetBSD)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
308 XCPPFLAGS += -I/usr/pkg/include
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
309 XLDFLAGS += -L/usr/pkg/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
310 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
311 ifeq ($(OS_NAME),SunOS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
312 XCPPFLAGS += -I/usr/xpg4/include -D__EXTENSIONS__
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
313 XLDFLAGS += -L/usr/xpg4/lib -R/usr/xpg4/lib
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
314 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
315 ifeq ($(findstring $(OS_NAME),FreeBSD DragonFly NetBSD OpenBSD),)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
316 XCPPFLAGS += -D_XOPEN_SOURCE=600
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
317 endif
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
318
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
319 $(LIBPWS_LIB): $(LIBPWS_LIB_MEMBERS)
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
320
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
321 $(eval $(call generate-manpage-rule,$(LIBPWS_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,$(PWS_INIT_MANPAGES)))
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
324
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
325 $(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
326
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
327 $(PWSDUMP_BIN): $(PWSDUMP_OBJS) $(LIBPWS_LIB) -lnettle
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
328
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
329 %.o: %.c
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
330 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
331 $(COMPILE.c) -o $@ $<
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
332
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
333 (%): %
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
334 $(AR) $(ARFLAGS) $@ $<
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
335 $(RANLIB) $@
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
336
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
337 %.xhtml: %.xml docbook-update-source-data.xsl
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
338 $(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
339 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
340 --stringparam package $(PACKAGE) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
341 --stringparam version $(VERSION) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
342 docbook-update-source-data.xsl $< | \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
343 $(XSLTPROC) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
344 --xinclude \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
345 --output $@ \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
346 $(DOCBOOK5_XHTML_FLAGS) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
347 $(DOCBOOK5_XHTML_STYLESHEET) \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
348 -
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
349
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
350 install:
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
351 for header in include/*.h; do \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
352 $(INSTALL.data) $${header} \
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
353 "$(DESTDIR)$(includedir)/$${header##*/}"; \
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
354 done
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
355 $(INSTALL.lib) $(LIBPWS_LIB) \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
356 "$(DESTDIR)$(libdir)/$(notdir $(LIBPWS_LIB))"
1
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
357 for manpage in $(MANPAGES); do \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
358 if [ -L $${manpage} ]; then \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
359 $(INSTALL.link) $${manpage} \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
360 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
361 else \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
362 $(INSTALL.data) $${manpage} \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
363 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
364 fi \
e1309515d111 Add README file and manpages
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 0
diff changeset
365 done
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
366
4
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
367 check: $(PWSDUMP_BIN)
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
368 rm -rf $(TESTS_OUTPUT_PATH); \
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
369 SHELL=$(SHELL) PWSDUMP=$(PWSDUMP_BIN) \
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
370 TESTS_OUTPUT_PATH=$(TESTS_OUTPUT_PATH) $(SHELL) tests/run-tests.sh
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
371
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
372 clean:
2
97097b4b6bfb Add pwsdump utility
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 1
diff changeset
373 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
374 $(XHTML_DOCUMENTATION)
4
dfd3ddbdb201 Add tests
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 2
diff changeset
375 rm -rf $(TESTS_OUTPUT_PATH)
0
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 clobber: clean
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
378 rm -f $(patsubst %.o,%.d,$(OBJS))
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
379
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
380 dist: clobber
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
381 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
382 -s ',^\.$$,,' -s ',\./,$(DISTNAME)/,' . | \
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
383 $(GZIP) > $(DISTNAME).tar.gz
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
384
10
0feba0fea9d0 Allow local makefile overrides in local.mk
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 4
diff changeset
385 -include local.mk
0feba0fea9d0 Allow local makefile overrides in local.mk
Guido Berhoerster <guido+libpws@berhoerster.name>
parents: 4
diff changeset
386
0
d541e748cfd8 Initial revision
Guido Berhoerster <guido+libpws@berhoerster.name>
parents:
diff changeset
387 -include $(patsubst %.o,%.d,$(OBJS))