]> sourceware.org Git - lvm2.git/blob - make.tmpl.in
Fix shared format1 build.
[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 the 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 CFLAGS += @CFLAGS@
28 CLDFLAGS += @CLDFLAGS@
29 CLDWHOLEARCHIVE += @CLDWHOLEARCHIVE@
30 CLDNOWHOLEARCHIVE += @CLDNOWHOLEARCHIVE@
31 LD_DEPS += @LD_DEPS@
32 LD_FLAGS += @LD_FLAGS@
33 SOFLAG += @SOFLAG@
34
35 # Setup directory variables
36 prefix = @prefix@
37 exec_prefix = @exec_prefix@
38 bindir = $(DESTDIR)@bindir@
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
46 # setup misc variables
47 # define the ownership variables for the binaries and man pages
48 OWNER = @OWNER@
49 GROUP = @GROUP@
50
51 # The number of jobs to run, if blank, defaults to the make standard
52 ifndef MAKEFLAGS
53 MAKEFLAGS = @JOBS@
54 endif
55
56 SUFFIXES = .c .d .o .so .a .po .pot .mo
57
58 CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline
59
60 #CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wmissing-noreturn
61
62 ifeq ("@DEBUG@", "yes")
63 CFLAGS += -g -fno-omit-frame-pointer -DDEBUG
64 CFLAGS += -DDEBUG_MEM
65 else
66 CFLAGS += -O2
67 endif
68
69 ifeq ("@INTL@", "yes")
70 CFLAGS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
71 endif
72
73 LD_FLAGS += -L$(top_srcdir)/lib -L$(libdir)
74
75 ifeq ("@STATIC_LINK@", "yes")
76 LD_FLAGS += -static
77 endif
78
79 #CFLAGS += -DDEBUG_POOL
80 #CFLAGS += -DBOUNDS_CHECK
81
82 #CFLAGS += -pg
83 #LD_FLAGS += -pg
84
85 STRIP=
86 #STRIP = -s
87
88 LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \
89 awk -F '.' '{printf "%s.%s",$$1,$$2}')
90
91 INCLUDES += -I. -I$(top_srcdir)/include
92
93 ifdef DESTDIR
94 INCLUDES += -I$(DESTDIR)/usr/include
95 endif
96
97 INC_LNS = $(top_srcdir)/include/.symlinks_created
98
99 DEPS = $(top_srcdir)/make.tmpl $(top_srcdir)/VERSION Makefile $(INC_LNS)
100
101 OBJECTS = $(SOURCES:%.c=%.o)
102 POTFILES = $(SOURCES:%.c=%.pot)
103
104 SUBDIRS.install := $(SUBDIRS:=.install)
105 SUBDIRS.pofile := $(SUBDIRS:=.pofile)
106 SUBDIRS.clean := $(SUBDIRS:=.clean)
107 SUBDIRS.distclean := $(SUBDIRS:=.distclean)
108
109 .PHONY: all install pofile distclean clean
110 .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
111 .PHONY: $(SUBDIRS.pofile)
112
113 TARGETS += $(LIB_SHARED) $(LIB_STATIC)
114
115 all: $(SUBDIRS) $(TARGETS)
116
117 install: all $(SUBDIRS.install)
118
119 $(SUBDIRS):
120 $(MAKE) -C $@
121
122 $(SUBDIRS.install): $(SUBDIRS)
123 $(MAKE) -C $(@:.install=) install
124
125 $(SUBDIRS.clean):
126 -$(MAKE) -C $(@:.clean=) clean
127
128 $(SUBDIRS.distclean):
129 -$(MAKE) -C $(@:.distclean=) distclean
130
131 ifeq ("@INTL@", "yes")
132 pofile: $(SUBDIRS.pofile) $(POTFILES)
133
134 $(SUBDIRS.pofile):
135 $(MAKE) -C $(@:.pofile=) pofile
136 endif
137
138 $(TARGETS): $(OBJECTS)
139
140 %.o: %.c
141 $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
142
143 %.pot: %.c
144 $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
145 $(CFLAGS) $< > $@
146
147 %.pot: Makefile
148
149 %.so: %.o
150 $(CC) -c $(INCLUDES) $(CFLAGS) %< -o $@
151
152 %.so: $(OBJECTS) $(LD_DEPS)
153 $(CC) $(SOFLAG) -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
154 $(CLDFLAGS) $(OBJECTS) -o $@
155
156 $(LIB_STATIC): $(OBJECTS)
157 $(RM) $@
158 $(AR) rs $@ $(OBJECTS)
159
160 %.d: %.c
161 set -e; \
162 FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
163 DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
164 $(CC) -MM $(INCLUDES) $(CFLAGS) $< | \
165 sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" > $@; \
166 [ -s $@ ] || $(RM) $@
167
168 %.mo: %.po
169 $(MSGFMT) -o $@ $<
170
171 clean: $(SUBDIRS.clean)
172 $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
173 $(SOURCES:%.c=%.pot) $(LD_DEPS)
174
175 distclean: $(SUBDIRS.distclean)
176 $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
177 $(SOURCES:%.c=%.pot) $(LD_DEPS) \
178 config.cache config.log config.status \
179 Makefile make.tmpl core \
180 version.h lvm2.po
181
182 .export.sym: .exported_symbols
183 set -e; (echo "Base {"; echo " global:"; \
184 sed "s/^/ /;s/$$/;/" < $<; \
185 echo " local:"; echo " *;"; echo "};") > $@
186
187 ifneq ($(MAKECMDGOALS),clean)
188 ifneq ($(MAKECMDGOALS),distclean)
189 ifdef SOURCES
190 -include $(SOURCES:.c=.d)
191 endif
192 endif
193 endif
194
This page took 0.048727 seconds and 6 git commands to generate.