]> sourceware.org Git - lvm2.git/blame - make.tmpl.in
Add usrsbindir to configure.
[lvm2.git] / make.tmpl.in
CommitLineData
795ca3e5
AK
1# @configure_input@
2#
6606c3ae 3# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
aa4d1e31 4# Copyright (C) 2004, 2008 Red Hat, Inc. All rights reserved.
795ca3e5 5#
7f8f8bfa 6# This file is part of LVM2.
795ca3e5 7#
6606c3ae
AK
8# This copyrighted material is made available to anyone wishing to use,
9# modify, copy, or redistribute it subject to the terms and conditions
10# of the GNU General Public License v.2.
795ca3e5 11#
6606c3ae
AK
12# You should have received a copy of the GNU General Public License
13# along with this program; if not, write to the Free Software Foundation,
14# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
795ca3e5
AK
15
16SHELL = /bin/sh
17
18@SET_MAKE@
19
20CC = @CC@
21RANLIB = @RANLIB@
22SHELL = /bin/sh
23INSTALL = @INSTALL@
5556819a 24MKDIR_P = @MKDIR_P@
69792976 25MSGFMT = @MSGFMT@
5556819a
AK
26LCOV = @LCOV@
27GENHTML = @GENHTML@
795ca3e5 28LN_S = @LN_S@
5f68d858 29LIBS = @LIBS@
72b2cb61 30DEFS += @DEFS@
e8fad838 31CFLAGS += @CFLAGS@
84510264 32CLDFLAGS += @CLDFLAGS@
80992638
AK
33LDDEPS += @LDDEPS@
34LDFLAGS += @LDFLAGS@
e4c11ad1 35LIB_SUFFIX = @LIB_SUFFIX@
795ca3e5
AK
36
37# Setup directory variables
639c84c1
AK
38prefix = @prefix@
39exec_prefix = @exec_prefix@
40bindir = $(DESTDIR)@bindir@
4a7f3eb2 41confdir = $(DESTDIR)@CONFDIR@/lvm
84510264 42includedir = $(DESTDIR)@includedir@
639c84c1
AK
43libdir = $(DESTDIR)@libdir@
44sbindir = $(DESTDIR)@sbindir@
45infodir = $(DESTDIR)@infodir@
46mandir = $(DESTDIR)@mandir@
47localedir = $(DESTDIR)@LOCALEDIR@
0a62c911 48staticdir = $(DESTDIR)@STATICDIR@
795ca3e5
AK
49
50# setup misc variables
51# define the ownership variables for the binaries and man pages
84510264
AK
52OWNER = @OWNER@
53GROUP = @GROUP@
795ca3e5
AK
54
55# The number of jobs to run, if blank, defaults to the make standard
56ifndef MAKEFLAGS
57MAKEFLAGS = @JOBS@
58endif
59
8a2fc586 60.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
795ca3e5 61
7c03887b 62CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security
03a8a07d 63
72b2cb61
AK
64#CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual
65#CFLAGS += -pedantic -std=gnu99
8ef2b021 66
8ce0cbda
AK
67CFLAGS += @COPTIMISE_FLAG@
68
8ef2b021 69ifeq ("@DEBUG@", "yes")
8a2fc586
AK
70 CFLAGS += -g -fno-omit-frame-pointer
71 DEFS += -DDEBUG
72 DEFS += -DDEBUG_MEM
8ef2b021 73endif
03a8a07d 74
69792976 75ifeq ("@INTL@", "yes")
8a2fc586 76 DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
69792976
AK
77endif
78
33f732c5
AK
79ifneq ("@DMDIR@", "")
80 LDFLAGS += -L@DMDIR@/lib/ioctl
3b007b27
AK
81 ifeq ("@DMEVENTD@", "yes")
82 LDFLAGS += -L@DMDIR@/dmeventd
83 endif
33f732c5
AK
84endif
85
80992638 86LDFLAGS += -L$(top_srcdir)/lib -L$(libdir)
03a8a07d 87
8a2fc586
AK
88#DEFS += -DDEBUG_POOL
89#DEFS += -DBOUNDS_CHECK
84510264
AK
90
91#CFLAGS += -pg
80992638 92#LDFLAGS += -pg
84510264
AK
93
94STRIP=
95#STRIP = -s
8ef2b021 96
5a52dca9
AK
97LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \
98 awk -F '.' '{printf "%s.%s",$$1,$$2}')
99
25fbec5b 100INCLUDES += -I$(top_srcdir)/include
795ca3e5 101
33f732c5 102ifneq ("@DMDIR@", "")
25fbec5b 103 INCLUDES += -I@DMDIR@/include
33f732c5
AK
104endif
105
4af6dc96 106ifdef DESTDIR
25fbec5b 107 INCLUDES += -I$(DESTDIR)/usr/include
4af6dc96
AK
108endif
109
84510264 110INC_LNS = $(top_srcdir)/include/.symlinks_created
a03f2320 111
84510264 112DEPS = $(top_srcdir)/make.tmpl $(top_srcdir)/VERSION Makefile $(INC_LNS)
14c61d2d 113
84510264
AK
114OBJECTS = $(SOURCES:%.c=%.o)
115POTFILES = $(SOURCES:%.c=%.pot)
795ca3e5 116
8a2fc586 117.PHONY: all install install_cluster pofile distclean clean cflow
cab8ea7c 118.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
8a2fc586 119.PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
cab8ea7c 120
795ca3e5 121SUBDIRS.install := $(SUBDIRS:=.install)
cab8ea7c 122SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster)
69792976 123SUBDIRS.pofile := $(SUBDIRS:=.pofile)
8a2fc586 124SUBDIRS.cflow := $(SUBDIRS:=.cflow)
795ca3e5
AK
125SUBDIRS.clean := $(SUBDIRS:=.clean)
126SUBDIRS.distclean := $(SUBDIRS:=.distclean)
127
d68a82ec
AK
128TARGETS += $(LIB_SHARED) $(LIB_STATIC)
129
795ca3e5
AK
130all: $(SUBDIRS) $(TARGETS)
131
132install: all $(SUBDIRS.install)
cab8ea7c 133install_cluster: all $(SUBDIRS.install_cluster)
795ca3e5
AK
134
135$(SUBDIRS):
136 $(MAKE) -C $@
137
3ba1348c 138$(SUBDIRS.install): $(SUBDIRS)
795ca3e5
AK
139 $(MAKE) -C $(@:.install=) install
140
cab8ea7c
AK
141$(SUBDIRS.install_cluster): $(SUBDIRS)
142 $(MAKE) -C $(@:.install_cluster=) install_cluster
143
795ca3e5 144$(SUBDIRS.clean):
5a52dca9 145 -$(MAKE) -C $(@:.clean=) clean
795ca3e5
AK
146
147$(SUBDIRS.distclean):
5a52dca9 148 -$(MAKE) -C $(@:.distclean=) distclean
795ca3e5 149
69792976
AK
150ifeq ("@INTL@", "yes")
151pofile: $(SUBDIRS.pofile) $(POTFILES)
152
153$(SUBDIRS.pofile):
154 $(MAKE) -C $(@:.pofile=) pofile
155endif
156
8a2fc586
AK
157ifneq ("@CFLOW_CMD@", "")
158cflow: $(SUBDIRS.cflow)
159
160$(SUBDIRS.cflow):
161 $(MAKE) -C $(@:.cflow=) cflow
162endif
163
84510264
AK
164$(TARGETS): $(OBJECTS)
165
795ca3e5 166%.o: %.c
25fbec5b 167 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
795ca3e5 168
c5ff6dfa 169%.pot: %.c Makefile
25fbec5b 170 $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
8a2fc586 171 $(DEFS) $(CFLAGS) $< > $@
69792976 172
5a52dca9 173%.so: %.o
25fbec5b 174 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
5a52dca9 175
e4c11ad1 176ifeq ("@LIB_SUFFIX@","so")
80992638 177$(LIB_SHARED): $(OBJECTS) $(LDDEPS)
e4c11ad1 178 $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
3b007b27 179 $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
e4c11ad1
AK
180endif
181
182ifeq ("@LIB_SUFFIX@","dylib")
183$(LIB_SHARED): $(OBJECTS) $(LDDEPS)
184 $(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \
3b007b27 185 $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
e4c11ad1 186endif
84510264 187
f0c9fe01
AK
188%.so: %.a
189 $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
3b007b27
AK
190 $(CFLAGS) $(CLDFLAGS) $(LIBS) -o $@ \
191 @CLDWHOLEARCHIVE@ $< @CLDNOWHOLEARCHIVE@
f0c9fe01 192
84510264
AK
193$(LIB_STATIC): $(OBJECTS)
194 $(RM) $@
195 $(AR) rs $@ $(OBJECTS)
5a52dca9 196
795ca3e5 197%.d: %.c
84510264
AK
198 set -e; \
199 FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
200 DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
25fbec5b 201 $(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) $< | \
84510264
AK
202 sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" > $@; \
203 [ -s $@ ] || $(RM) $@
795ca3e5 204
69792976
AK
205%.mo: %.po
206 $(MSGFMT) -o $@ $<
207
795ca3e5 208clean: $(SUBDIRS.clean)
84510264 209 $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
5556819a
AK
210 $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
211 $(SOURCES:%.c=%.gcda) $(LDDEPS)
795ca3e5 212
5556819a
AK
213distclean: $(SUBDIRS.distclean)
214 $(RM) -rf $(DISTCLEAN_DIRS)
fddafd51 215 $(RM) $(DISTCLEAN_TARGETS) \
5556819a
AK
216 $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
217 $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
218 $(SOURCES:%.c=%.gcda) $(LDDEPS) \
84510264
AK
219 config.cache config.log config.status \
220 Makefile make.tmpl core \
221 version.h lvm2.po
222
223.export.sym: .exported_symbols
224 set -e; (echo "Base {"; echo " global:"; \
225 sed "s/^/ /;s/$$/;/" < $<; \
226 echo " local:"; echo " *;"; echo "};") > $@
795ca3e5
AK
227
228ifneq ($(MAKECMDGOALS),clean)
229 ifneq ($(MAKECMDGOALS),distclean)
230 ifdef SOURCES
231 -include $(SOURCES:.c=.d)
232 endif
233 endif
234endif
235
This page took 0.073411 seconds and 5 git commands to generate.