-
Notifications
You must be signed in to change notification settings - Fork 72
/
Makefile.in
124 lines (103 loc) · 3.56 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
## Copyright © 2018 The OpenEBS Authors
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
# top Makefile
top_srcdir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
datarootdir = @datarootdir@
datadir = @datadir@
libexecdir = @libexecdir@
mandir = @mandir@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
document = COPYRIGHT README INSTALL ChangeLog.jp
VER_H = src/istgt_ver.h
DISTBASE = istgt
DISTVER = `sed -e '/ISTGT_VERSION/!d' -e 's/[^0-9.]*\([0-9.a-z]*\).*/\1/' $(VER_H)`
DISTEXTVER = `sed -e '/ISTGT_EXTRA_VERSION/!d' -e 's/[^0-9.]*\([0-9.a-z]*\).*/\1/' $(VER_H)`
#DISTDIR = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
#DISTDIR = $(DISTBASE)-$(DISTVER)-$(DISTEXTVER)
DISTDIR = $(DISTBASE)-$(DISTEXTVER)
DISTNAME = $(DISTDIR).tar.gz
DISTFILES = Makefile.in configure.in config.guess config.sub install-sh configure \
$(header) $(source) $(ctl_header) $(ctl_source) \
$(document) $(sample)
SUBDIRS = src etc doc
#########################################################################
.PHONY: all install install-doc
all:
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
install:
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
install-doc:
for subdir in doc; do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
.PHONY: dist clean distclean local-clean local-distclean depend
dist: distdir
rm -rf $(DISTDIR) $(DISTNAME)
mkdir $(DISTDIR)
for file in $(DISTFILES); do \
cp -p $(srcdir)/$$file $(DISTDIR); \
done
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) subdir=$$subdir $@) || exit $$?; \
done
tar cf - $(DISTDIR) | gzip -9c > $(DISTNAME)
rm -rf $(DISTDIR) distdir
distdir:
echo $(DISTDIR) >$@
cstyle:
find $(top_srcdir) -name '*.[hc]' \
! -path './src/config.h' \
! -name 'rte_*.[hc]' -type f -exec $(top_srcdir)/cstyle.pl -cpP {} \+
clean: local-clean
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
distclean: clean local-distclean
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
local-clean:
-rm -f a.out *.o *.core
-rm -f *~
local-distclean: local-clean
-rm -f Makefile config.status config.cache config.log config.h
-rm -f $(DISTNAME) distdir
depend:
for subdir in $(SUBDIRS); do \
(cd $$subdir; $(MAKE) $@) || exit $$?; \
done
.PHONY: check_license
check_license: check_license
echo ">> checking license header"
licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.c\|.*\.h\|.*Docker.*' ! -path './src/config.h') ; do \
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi
#########################################################################