]> git.proxmox.com Git - mirror_kronosnet.git/blame - Makefile.am
[RX] Discard incoming packets if knet cannot reply back.
[mirror_kronosnet.git] / Makefile.am
CommitLineData
ab4c538f 1#
ec84794b 2# Copyright (C) 2010-2019 Red Hat, Inc. All rights reserved.
ab4c538f
FDN
3#
4# Author: Fabio M. Di Nitto <fabbione@kronosnet.org>
5#
312ef273 6# This software licensed under GPL-2.0+
ab4c538f
FDN
7#
8
99afbd6e
FDN
9MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
10 config.guess config.sub missing install-sh \
4a039866 11 ltmain.sh compile config.h.in config.h.in~ \
2b1072db
FW
12 autoscan.log configure.scan test-driver \
13 m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \
14 m4/ltsugar.m4 m4/ltversion.m4
99afbd6e 15
60c8735d
FDN
16include $(top_srcdir)/build-aux/check.mk
17
99afbd6e
FDN
18AUTOMAKE_OPTIONS = foreign
19
20ACLOCAL_AMFLAGS = -I m4
21
07072a06
FDN
22SPEC = $(PACKAGE_NAME).spec
23
24TARGZFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz
19ceca42 25
f508dc40 26EXTRA_DIST = autogen.sh .version \
6063577b 27 NOTES_TO_PACKAGE_MAINTAINERS \
31945b18 28 $(SPEC).in build-aux
07072a06 29
de3d1e09 30SUBDIRS = init libnozzle libknet kronosnetd
31945b18
FDN
31
32if BUILD_MAN
33SUBDIRS += man
34endif
ee9a7a24 35
1c75eb10
FDN
36if BUILD_POC
37SUBDIRS += poc-code
38endif
39
c8ed20e0 40dist_doc_DATA = \
51345ee1
FDN
41 COPYING.applications \
42 COPYING.libraries \
43 COPYRIGHT \
afce19e1 44 README.licence \
41ed0fff 45 README
51345ee1 46
5a8b1b49 47all-local: $(SPEC)
07072a06
FDN
48
49clean-local:
38349d88 50 rm -rf $(SPEC) cov*
07072a06
FDN
51
52distclean-local:
e40760a5 53 rm -f $(PACKAGE_NAME)-*.tar.* $(PACKAGE_NAME)-*.sha256* tag-*
07072a06 54
07072a06
FDN
55## make rpm/srpm section.
56
b01d08ab 57$(SPEC): $(SPEC).in .version config.status
07072a06 58 rm -f $@-t $@
3e837299 59 date="`LC_ALL=C $(UTC_DATE_AT)$(SOURCE_EPOCH) "+%a %b %d %Y"`" && \
16a6ede8
FDN
60 if [ -f $(abs_srcdir)/.tarball-version ]; then \
61 gitver="`cat $(abs_srcdir)/.tarball-version`" && \
07072a06
FDN
62 rpmver=$$gitver && \
63 alphatag="" && \
64 dirty="" && \
65 numcomm="0"; \
a12278b1 66 elif [ "`git log -1 --pretty=format:x . 2>&1`" = "x" ]; then \
d3210618 67 gitver="`GIT_DIR=$(abs_srcdir)/.git git describe --abbrev=4 --match='v*' HEAD 2>/dev/null`" && \
07072a06
FDN
68 rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \
69 alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \
70 vtag=`echo $$gitver | sed -e "s/-.*//g"` && \
df53bf84 71 numcomm=`GIT_DIR=$(abs_srcdir)/.git git rev-list $$vtag..HEAD | wc -l` && \
9bda758d
FDN
72 cd $(abs_srcdir) && \
73 git update-index --refresh > /dev/null 2>&1 || true && \
74 dirty=`git diff-index --name-only HEAD 2>/dev/null` && cd - 2>/dev/null; \
a12278b1
JF
75 else \
76 gitver="`cd $(abs_srcdir); build-aux/git-version-gen .tarball-version .gitarchivever`" && \
77 rpmver=$$gitver && \
78 alphatag="" && \
79 dirty="" && \
80 numcomm="0"; \
07072a06
FDN
81 fi && \
82 if [ -n "$$dirty" ]; then dirty="dirty"; else dirty=""; fi && \
83 if [ "$$numcomm" = "0" ]; then \
84 sed \
85 -e "s#@version@#$$rpmver#g" \
86 -e "s#%glo.*alpha.*##g" \
87 -e "s#%glo.*numcomm.*##g" \
88 -e "s#@dirty@#$$dirty#g" \
89 -e "s#@date@#$$date#g" \
d3210618 90 $(abs_srcdir)/$@.in > $@-t; \
07072a06
FDN
91 else \
92 sed \
93 -e "s#@version@#$$rpmver#g" \
94 -e "s#@alphatag@#$$alphatag#g" \
95 -e "s#@numcomm@#$$numcomm#g" \
96 -e "s#@dirty@#$$dirty#g" \
97 -e "s#@date@#$$date#g" \
d3210618 98 $(abs_srcdir)/$@.in > $@-t; \
07072a06
FDN
99 fi; \
100 if [ -z "$$dirty" ]; then sed -i -e "s#%glo.*dirty.*##g" $@-t; fi
50df9cde 101if BUILD_SCTP
20f9cc1e
FDN
102 sed -i -e "s#@sctp@#bcond_without#g" $@-t
103else
104 sed -i -e "s#@sctp@#bcond_with#g" $@-t
105endif
c7937384 106if BUILD_CRYPTO_NSS
20f9cc1e
FDN
107 sed -i -e "s#@nss@#bcond_without#g" $@-t
108else
109 sed -i -e "s#@nss@#bcond_with#g" $@-t
110endif
c7937384 111if BUILD_CRYPTO_OPENSSL
62c0a9f9
FDN
112 sed -i -e "s#@openssl@#bcond_without#g" $@-t
113else
114 sed -i -e "s#@openssl@#bcond_with#g" $@-t
115endif
c7937384 116if BUILD_COMPRESS_ZLIB
20f9cc1e
FDN
117 sed -i -e "s#@zlib@#bcond_without#g" $@-t
118else
119 sed -i -e "s#@zlib@#bcond_with#g" $@-t
120endif
c7937384 121if BUILD_COMPRESS_LZ4
20f9cc1e
FDN
122 sed -i -e "s#@lz4@#bcond_without#g" $@-t
123else
124 sed -i -e "s#@lz4@#bcond_with#g" $@-t
125endif
c7937384 126if BUILD_COMPRESS_LZO2
20f9cc1e
FDN
127 sed -i -e "s#@lzo2@#bcond_without#g" $@-t
128else
129 sed -i -e "s#@lzo2@#bcond_with#g" $@-t
130endif
c7937384 131if BUILD_COMPRESS_LZMA
20f9cc1e
FDN
132 sed -i -e "s#@lzma@#bcond_without#g" $@-t
133else
134 sed -i -e "s#@lzma@#bcond_with#g" $@-t
135endif
c7937384 136if BUILD_COMPRESS_BZIP2
20f9cc1e
FDN
137 sed -i -e "s#@bzip2@#bcond_without#g" $@-t
138else
139 sed -i -e "s#@bzip2@#bcond_with#g" $@-t
140endif
2754268f
FDN
141if BUILD_COMPRESS_ZSTD
142 sed -i -e "s#@zstd@#bcond_without#g" $@-t
143else
144 sed -i -e "s#@zstd@#bcond_with#g" $@-t
145endif
b01d08ab 146if BUILD_KRONOSNETD
45ede404 147 sed -i -e "s#@kronosnetd@#bcond_without#g" $@-t
b01d08ab 148else
45ede404 149 sed -i -e "s#@kronosnetd@#bcond_with#g" $@-t
b01d08ab 150endif
de3d1e09
FDN
151if BUILD_LIBNOZZLE
152 sed -i -e "s#@libnozzle@#bcond_without#g" $@-t
b01d08ab 153else
de3d1e09 154 sed -i -e "s#@libnozzle@#bcond_with#g" $@-t
8f8384a0
BL
155endif
156if BUILD_RUNAUTOGEN
157 sed -i -e "s#@runautogen@#bcond_without#g" $@-t
158else
159 sed -i -e "s#@runautogen@#bcond_with#g" $@-t
b01d08ab 160endif
73677ca3
BL
161if OVERRIDE_RPM_DEBUGINFO
162 sed -i -e "s#@overriderpmdebuginfo@#bcond_without#g" $@-t
163else
164 sed -i -e "s#@overriderpmdebuginfo@#bcond_with#g" $@-t
165endif
73677ca3
BL
166if BUILD_RPM_DEBUGINFO
167 sed -i -e "s#@rpmdebuginfo@#bcond_without#g" $@-t
168else
169 sed -i -e "s#@rpmdebuginfo@#bcond_with#g" $@-t
2414bd86
FDN
170endif
171if BUILD_MAN
172 sed -i -e "s#@buildman@#bcond_without#g" $@-t
173else
174 sed -i -e "s#@buildman@#bcond_with#g" $@-t
ccf9dee1
FDN
175endif
176if INSTALL_TESTS
177 sed -i -e "s#@installtests@#bcond_without#g" $@-t
178else
179 sed -i -e "s#@installtests@#bcond_with#g" $@-t
73677ca3 180endif
2e687dd8 181 sed -i -e "s#@defaultadmgroup@#$(DEFAULTADMGROUP)#g" $@-t
07072a06
FDN
182 chmod a-w $@-t
183 mv $@-t $@
8e55f6a8 184 rm -f $@-t*
07072a06
FDN
185
186$(TARGZFILE):
187 $(MAKE) dist
188
189RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
190 --define "_specdir $(abs_builddir)" \
191 --define "_builddir $(abs_builddir)" \
192 --define "_srcrpmdir $(abs_builddir)" \
193 --define "_rpmdir $(abs_builddir)"
194
195srpm: clean
196 $(MAKE) $(SPEC) $(TARGZFILE)
197 rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
198
199rpm: clean
200 $(MAKE) $(SPEC) $(TARGZFILE)
201 rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
202
203# release/versioning
204BUILT_SOURCES = .version
205.version:
206 echo $(VERSION) > $@-t && mv $@-t $@
207
208dist-hook: gen-ChangeLog
209 echo $(VERSION) > $(distdir)/.tarball-version
b722c26c 210 echo $(SOURCE_EPOCH) > $(distdir)/source_epoch
07072a06
FDN
211
212gen_start_date = 2000-01-01
213.PHONY: gen-ChangeLog
214gen-ChangeLog:
98c94bd4 215 if test -d $(abs_srcdir)/.git; then \
7ffc6992 216 LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \
07072a06
FDN
217 --since=$(gen_start_date) > $(distdir)/cl-t; \
218 rm -f $(distdir)/ChangeLog; \
219 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
220 fi