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