]>
Commit | Line | Data |
---|---|---|
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 | |
16 | SHELL = /bin/sh | |
17 | ||
18 | @SET_MAKE@ | |
19 | ||
20 | CC = @CC@ | |
21 | RANLIB = @RANLIB@ | |
22 | SHELL = /bin/sh | |
23 | INSTALL = @INSTALL@ | |
69792976 | 24 | MSGFMT = @MSGFMT@ |
795ca3e5 | 25 | LN_S = @LN_S@ |
5f68d858 | 26 | LIBS = @LIBS@ |
57d5318d | 27 | CFLAGS += @DEFS@ |
e8fad838 | 28 | CFLAGS += @CFLAGS@ |
84510264 AK |
29 | CLDFLAGS += @CLDFLAGS@ |
30 | CLDWHOLEARCHIVE += @CLDWHOLEARCHIVE@ | |
31 | CLDNOWHOLEARCHIVE += @CLDNOWHOLEARCHIVE@ | |
80992638 AK |
32 | LDDEPS += @LDDEPS@ |
33 | LDFLAGS += @LDFLAGS@ | |
84510264 | 34 | SOFLAG += @SOFLAG@ |
795ca3e5 AK |
35 | |
36 | # Setup directory variables | |
639c84c1 AK |
37 | prefix = @prefix@ |
38 | exec_prefix = @exec_prefix@ | |
39 | bindir = $(DESTDIR)@bindir@ | |
4a7f3eb2 | 40 | confdir = $(DESTDIR)@CONFDIR@/lvm |
84510264 | 41 | includedir = $(DESTDIR)@includedir@ |
639c84c1 AK |
42 | libdir = $(DESTDIR)@libdir@ |
43 | sbindir = $(DESTDIR)@sbindir@ | |
44 | infodir = $(DESTDIR)@infodir@ | |
45 | mandir = $(DESTDIR)@mandir@ | |
46 | localedir = $(DESTDIR)@LOCALEDIR@ | |
0a62c911 | 47 | staticdir = $(DESTDIR)@STATICDIR@ |
795ca3e5 AK |
48 | |
49 | # setup misc variables | |
50 | # define the ownership variables for the binaries and man pages | |
84510264 AK |
51 | OWNER = @OWNER@ |
52 | GROUP = @GROUP@ | |
795ca3e5 AK |
53 | |
54 | # The number of jobs to run, if blank, defaults to the make standard | |
55 | ifndef MAKEFLAGS | |
56 | MAKEFLAGS = @JOBS@ | |
57 | endif | |
58 | ||
84510264 | 59 | SUFFIXES = .c .d .o .so .a .po .pot .mo |
795ca3e5 | 60 | |
84510264 | 61 | CFLAGS += -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 |
65 | CFLAGS += @COPTIMISE_FLAG@ |
66 | ||
8ef2b021 | 67 | ifeq ("@DEBUG@", "yes") |
84510264 AK |
68 | CFLAGS += -g -fno-omit-frame-pointer -DDEBUG |
69 | CFLAGS += -DDEBUG_MEM | |
8ef2b021 | 70 | endif |
03a8a07d | 71 | |
69792976 | 72 | ifeq ("@INTL@", "yes") |
84510264 | 73 | CFLAGS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\" |
69792976 AK |
74 | endif |
75 | ||
80992638 | 76 | LDFLAGS += -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 | |
84 | STRIP= | |
85 | #STRIP = -s | |
8ef2b021 | 86 | |
5a52dca9 AK |
87 | LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \ |
88 | awk -F '.' '{printf "%s.%s",$$1,$$2}') | |
89 | ||
84510264 | 90 | INCLUDES += -I. -I$(top_srcdir)/include |
795ca3e5 | 91 | |
4af6dc96 | 92 | ifdef DESTDIR |
84510264 | 93 | INCLUDES += -I$(DESTDIR)/usr/include |
4af6dc96 AK |
94 | endif |
95 | ||
84510264 | 96 | INC_LNS = $(top_srcdir)/include/.symlinks_created |
a03f2320 | 97 | |
84510264 | 98 | DEPS = $(top_srcdir)/make.tmpl $(top_srcdir)/VERSION Makefile $(INC_LNS) |
14c61d2d | 99 | |
84510264 AK |
100 | OBJECTS = $(SOURCES:%.c=%.o) |
101 | POTFILES = $(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 | 107 | SUBDIRS.install := $(SUBDIRS:=.install) |
cab8ea7c | 108 | SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster) |
69792976 | 109 | SUBDIRS.pofile := $(SUBDIRS:=.pofile) |
795ca3e5 AK |
110 | SUBDIRS.clean := $(SUBDIRS:=.clean) |
111 | SUBDIRS.distclean := $(SUBDIRS:=.distclean) | |
112 | ||
d68a82ec AK |
113 | TARGETS += $(LIB_SHARED) $(LIB_STATIC) |
114 | ||
795ca3e5 AK |
115 | all: $(SUBDIRS) $(TARGETS) |
116 | ||
117 | install: all $(SUBDIRS.install) | |
cab8ea7c | 118 | install_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 |
135 | ifeq ("@INTL@", "yes") |
136 | pofile: $(SUBDIRS.pofile) $(POTFILES) | |
137 | ||
138 | $(SUBDIRS.pofile): | |
139 | $(MAKE) -C $(@:.pofile=) pofile | |
140 | endif | |
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 | 173 | clean: $(SUBDIRS.clean) |
84510264 | 174 | $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \ |
80992638 | 175 | $(SOURCES:%.c=%.pot) $(LDDEPS) |
795ca3e5 AK |
176 | |
177 | distclean: $(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 | |
189 | ifneq ($(MAKECMDGOALS),clean) | |
190 | ifneq ($(MAKECMDGOALS),distclean) | |
191 | ifdef SOURCES | |
192 | -include $(SOURCES:.c=.d) | |
193 | endif | |
194 | endif | |
195 | endif | |
196 |