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