-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathMakefile.in
182 lines (145 loc) · 6.13 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
## Copyright © 2018-2020 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.
#########################################################################
# Makefile for istgt
#########################################################################
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@
REPLICATION_BIN = @replication_bin@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir) -I$(srcdir)
LDFLAGS = @LDFLAGS@ -rdynamic
DEFS = @DEFS@
LIBS = @LIBS@
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@
RANLIB = @RANLIB@
MKDEP = @MKDEP@
CFLAGS += -fno-strict-aliasing -Wstrict-aliasing
CFLAGS += -Wformat=2 -Wreturn-type
CFLAGS += -Wbad-function-cast -Wuninitialized -Wunused-variable -Wunused-label -Wunused-function -Wsign-compare -Wno-missing-field-initializers -Wno-missing-braces
CFLAGS += -Wcast-qual -Wchar-subscripts -Winline
CFLAGS += -Wmissing-prototypes -Wnested-externs -Wpointer-arith
CFLAGS += -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
CFLAGS += -Wno-error=cast-align
CFLAGS += --param max-inline-insns-single=1000
istgt_source = istgt.c istgt_iscsi.c istgt_iscsi_param.c istgt_lu.c \
istgt_cmd_table.c istgt_ser_table.c istgt_lu_disk.c \
istgt_lu_disk_xcopy.c istgt_lu_disk_vbox.c istgt_lu_ctl.c \
istgt_log.c istgt_conf.c istgt_sock.c istgt_misc.c \
istgt_queue.c istgt_crc32c.c istgt_md5.c
istgt_header = istgt_ver.h istgt.h istgt_iscsi.h istgt_iscsi_xcopy.h istgt_iscsi_param.h \
istgt_scsi.h istgt_proto.h istgt_lu.h istgt_log.h istgt_conf.h istgt_sock.h \
istgt_misc.h istgt_queue.h istgt_crc32c.h istgt_md5.h
replication_source = replication.c replication_misc.c ring_mempool.c rte_ring.c data_conn.c
replication_header = replication.h istgt_integration.h zrepl_prot.h \
arch/x86/rte_atomic_64.h arch/x86/rte_atomic_32.h arch/x86/rte_atomic.h arch/x86/rte_pause.h \
arch/arm/rte_pause.h arch/arm/rte_pause_32.h arch/arm/rte_pause_64.h arch/arm/rte_atomic.h arch/arm/rte_atomic_32.h arch/arm/rte_atomic_64.h \
generic/rte_atomic.h generic/rte_pause.h \
arch/ppc/rte_pause.h arch/ppc/rte_atomic.h \
rte_common.h rte_memory.h rte_pause.h rte_ring.h rte_mempool.h
target_source = @target_source_files@
target_header = @target_header_files@
ctl_source = istgtcontrol.c istgt_conf.c istgt_log.c istgt_sock.c istgt_misc.c \
istgt_md5.c
ctl_header = istgt_ver.h istgt_conf.h istgt_log.h istgt_sock.h istgt_misc.h \
istgt_md5.h
istgt_integration_source = istgt_integration_test.c mock_client.c replication.c replication_misc.c rte_ring.c \
ring_mempool.c data_conn.c istgt_misc.c mock_errored_replica.c istgt_sock.c
replication_test_source = replication_test.c replication_misc.c
replication_test_header = replication.h istgt_integration.h
mempool_test_source = rte_ring.c mempool_test.c ring_mempool.c
ISTGT = $(target_source:.c=.o)
ISTGTCONTROL = $(ctl_source:.c=.o)
REPLICATION_TEST = $(replication_test_source:.c=.o)
ISTGT_INTEGRATION = $(istgt_integration_source:.c=.o)
MEMPOOL_TEST = $(mempool_test_source:.c=.o)
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
VER_H = 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)
DISTDIR = $(top_srcdir)/`cat $(top_srcdir)/distdir`
DISTNAME = $(DISTDIR).tar.gz
DISTFILES = Makefile.in config.h.in build.h.in \
$(target_header) $(target_source) $(ctl_header) $(ctl_source)
#########################################################################
.SUFFIXES: .c .o
.c.o:
$(CC) $(DEFS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
.PHONY: all install install-dirs
default: all;
istgt: $(ISTGT)
$(CC) $(LDFLAGS) -o ${@} $(ISTGT) $(LIBS)
istgtcontrol: $(ISTGTCONTROL)
$(CC) $(LDFLAGS) -o ${@} $(ISTGTCONTROL) $(LIBS)
replication_test: $(REPLICATION_TEST)
$(CC) $(LDFLAGS) -o ${@} $(REPLICATION_TEST) $(LIBS)
istgt_integration: $(ISTGT_INTEGRATION)
$(CC) $(LDFLAGS) -o ${@} $(ISTGT_INTEGRATION) $(LIBS)
mempool_test: $(MEMPOOL_TEST)
$(CC) $(LDFLAGS) -o ${@} $(MEMPOOL_TEST) $(LIBS)
build_image:
sh ./package.sh
all: stamp-depend config.h istgtcontrol istgt $(REPLICATION_BIN)
dev: stamp-depend config.h istgtcontrol istgt $(REPLICATION_BIN)
install: install-dirs
$(INSTALL) -m 0755 istgt $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 istgtcontrol $(DESTDIR)$(bindir)
install-dirs:
$(MKDIR_P) $(DESTDIR)$(bindir)
.PHONY: dist clean distclean depend
dist: $(DISTFILES)
if [ -f "$(top_srcdir)/distdir" ]; then \
$(MKDIR_P) $(DISTDIR)/$(subdir) \
cd $(srcdir); thisdir=`pwd`; \
for file in `echo $(DISTFILES) | sort`; do \
cp -p $$thisdir/$$file $(DISTDIR)/$(subdir); \
done \
fi
depend:
if [ "x$(MKDEP)" != "x" ]; then \
$(MKDEP) -MM $(DEFS) $(CFLAGS) $(CPPFLAGS) $(target_source); \
fi
touch stamp-depend
clean:
-rm -f a.out *.o *.core
-rm -f *~
-rm -f istgt istgtcontrol
-rm -f replication_test istgt_integration mempool_test
distclean: clean
-rm -f stamp-depend .depend
-rm -f stamp-h.in
-rm -f Makefile config.status config.cache config.log config.h
-rm -f build.h
#########################################################################
stamp-depend: Makefile
$(MAKE) depend
#########################################################################