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