annotate Makefile @ 10:8e9dd5328b5a

Print a warning message when using an insecure algorithm
author Guido Berhoerster <guido+sencrypt@berhoerster.name>
date Sat, 03 Sep 2016 14:02:42 +0200
parents 112d55c825b4
children 27bc2d4947da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
1 #
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
2 # Copyright (C) 2014 Guido Berhoerster <guido+sencrypt@berhoerster.name>
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
3 #
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
11 #
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
14 #
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
22 #
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
23
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
24 PACKAGE = sencrypt
7
112d55c825b4 Release version 2
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 1
diff changeset
25 VERSION = 2
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
26 DISTNAME := $(PACKAGE)-$(VERSION)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
27 DECRYPT_ALIAS = sdecrypt
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
28
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
29 COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
30 # gcc, clang, icc
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
31 MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
32 # Sun/Solaris Studio
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
33 #MAKEDEPEND.c = $(CC) -xM1 $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
34 # X makedepend
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
35 #MAKEDEPEND.c = makedepend -f- -Y -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) --
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
36 LINK.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
37 LINK.o = $(CC) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
38 INSTALL := install
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
39 INSTALL.exec := $(INSTALL) -D -m 0755
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
40 INSTALL.data := $(INSTALL) -D -m 0644
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
41 PAX := pax
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
42 GZIP := gzip
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
43 SED := sed
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
44 XSLTPROC := xsltproc
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
45 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
46
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
47 define generate-manpage-rule =
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
48 %.$(1): %.$(1).xml
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
49 $$(XSLTPROC) \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
50 --xinclude \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
51 --stringparam package $$(PACKAGE) \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
52 --stringparam version $$(VERSION)\
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
53 docbook-update-source-data.xsl $$< | \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
54 $$(XSLTPROC) \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
55 --xinclude \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
56 $$(DOCBOOK5_MANPAGES_FLAGS) \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
57 --output $$@ \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
58 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
59 -
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
60 endef
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
61
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
62 DESTDIR ?=
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
63 prefix ?= /usr/local
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
64 bindir ?= $(prefix)/bin
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
65 datadir ?= $(prefix)/share
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
66 mandir ?= $(datadir)/man
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
67
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
68 HAVE_ERR_H ?= 1
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
69
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
70 OBJS = sencrypt.o
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
71 MANPAGES = $(PACKAGE).1 $(DECRYPT_ALIAS).1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
72 DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
73 --stringparam man.copyright.section.enabled 0
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
74
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
75 ifeq ($(HAVE_ERR_H),0)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
76 OBJS += err.o
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
77 endif
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
78
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
79 .DEFAULT_TARGET = all
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
80
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
81 .PHONY: all clean clobber dist install
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
82
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
83 all: $(PACKAGE) $(MANPAGES)
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
84
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
85 $(PACKAGE): XCPPFLAGS := -DOPENSSL_LOAD_CONF
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
86 ifeq ($(HAVE_ERR_H),1)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
87 $(PACKAGE): XCPPFLAGS += -DHAVE_ERR_H
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
88 endif
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
89 $(PACKAGE): XCFLAGS := $(shell getconf LFS_CFLAGS)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
90 $(PACKAGE): LDLIBS := -lcrypto
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
91 $(PACKAGE): XLDFLAGS := $(shell getconf LFS_LDFLAGS)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
92 $(PACKAGE): $(OBJS)
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
93 $(LINK.o) $^ $(LDLIBS) -o $@
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
94
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
95 $(foreach section,1 2 3 4 5 6 7 8 9,$(eval $(call generate-manpage-rule,$(section))))
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
96
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
97 %.o: %.c
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
98 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
99 $(COMPILE.c) -o $@ $<
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
100
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
101 install:
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
102 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)"
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
103 ln -f $(PACKAGE) "$(DESTDIR)$(bindir)/$(DECRYPT_ALIAS)"
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
104 for manpage in $(MANPAGES); do \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
105 $(INSTALL.data) $${manpage} \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
106 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
107 done
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
108
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
109 clean:
1
f0ceb0ad20e7 Add manpage
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents: 0
diff changeset
110 rm -f $(PACKAGE) $(OBJS) $(MANPAGES)
0
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
111
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
112 clobber: clean
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
113 rm -f $(patsubst %.o,%.d,$(OBJS))
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
114
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
115 dist: clobber
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
116 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
117 -s ',\./,$(DISTNAME)/,' . | $(GZIP) > $(DISTNAME).tar.gz
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
118
73af139d1a94 Initial revision
Guido Berhoerster <guido+sencrypt@berhoerster.name>
parents:
diff changeset
119 -include $(patsubst %.o,%.d,$(OBJS))