]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/builddefs.in
rework for libtool support.
[thirdparty/xfsprogs-dev.git] / include / builddefs.in
CommitLineData
2bd0ea18
NS
1#
2# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of version 2 of the GNU General Public License as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope that it would be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11#
12# Further, this software is distributed without any warranty that it is
13# free of the rightful claim of any third person regarding infringement
14# or the like. Any license provided herein, whether implied or
15# otherwise, applies only to this software file. Patent licenses, if
16# any, provided herein do not apply to combinations of this program with
17# other software, or any other product whatsoever.
18#
19# You should have received a copy of the GNU General Public License along
20# with this program; if not, write the Free Software Foundation, Inc., 59
21# Temple Place - Suite 330, Boston MA 02111-1307, USA.
22#
23# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24# Mountain View, CA 94043, or:
25#
26# http://www.sgi.com
27#
28# For further information regarding this notice, see:
29#
30# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31#
32# @configure_input@
33#
34
35ifndef _BUILDDEFS_INCLUDED_
36_BUILDDEFS_INCLUDED_ = 1
37
38DEBUG = @debug_build@
39OPTIMIZER = @opt_build@
40MALLOCLIB = @malloc_lib@
41
639231be 42LIBUUID = @libuuid@
f937adac
NS
43LIBXFS = $(TOPDIR)/libxfs/libxfs.la
44LIBDISK = $(TOPDIR)/libdisk/libdisk.la
45LIBHANDLE = $(TOPDIR)/libhandle/libhandle.la
fc49813f 46
2bd0ea18 47LIBLVM = @liblvm@
fc49813f 48USELVM = -DHAVE_LIBLVM=@have_liblvm@
f937adac 49DK_INC_DIR = @dk_inc_dir@
2bd0ea18 50
fc49813f
NS
51PKG_NAME = @pkg_name@
52PKG_RELEASE = @pkg_release@
53PKG_VERSION = @pkg_version@
54PKG_DISTRIBUTION = @pkg_distribution@
55PKG_BUILDER = @pkg_builder@
56PKG_BIN_DIR = @pkg_bin_dir@
57PKG_LIB_DIR = @pkg_lib_dir@
58PKG_SBIN_DIR = @pkg_sbin_dir@
59PKG_SLIB_DIR = @pkg_slib_dir@
60PKG_INC_DIR = @pkg_inc_dir@
61PKG_MAN_DIR = @pkg_man_dir@
62PKG_DOC_DIR = @pkg_doc_dir@
2bd0ea18 63
f937adac
NS
64CC = @cc@
65LD = @ld@
66AWK = @awk@
67SED = @sed@
68MAKE = @make@
69ECHO = @echo@
70LN_S = @LN_S@
71ZIP = @zip@
72TAR = @tar@
73RPM = @rpm@
74
75RPM_VERSION = @rpm_version@
76HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
77MAKEDEPEND = @makedepend@
78
79LIBTOOL = @LIBTOOL@
80LIBTOOL_DEPS = @LIBTOOL_DEPS@
81ENABLE_SHARED = @enable_shared@
82
83#
84# end configure'd section
85
86
87BUILDRULES = $(TOPDIR)/include/buildrules
88
2bd0ea18
NS
89# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in
90# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES)
91# $(CXXFILES), or $(HFILES) and is used to construct the manifest list
92# during the "dist" phase (packaging).
93
f91dde66 94CFLAGS += -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall $(LCFLAGS) \
27527004
NS
95 -I$(TOPDIR)/include '-DVERSION="$(PKG_VERSION)"' -D_GNU_SOURCE \
96 -D_FILE_OFFSET_BITS=64 -DXFS_BIG_FILES=1 -DXFS_BIG_FILESYSTEMS=1
2bd0ea18
NS
97
98LDFLAGS = $(LLDFLAGS)
99LDLIBS = $(LLDLIBS) $(MALLOCLIB)
100
101MAKEOPTS = --no-print-directory
102SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
f937adac 103DIRT = $(LDIRT) dep dep.bak $(OBJECTS) $(LTCOMMAND) $(LTLIBRARY) *.[1-9].gz
2bd0ea18
NS
104
105OBJECTS = $(ASFILES:.s=.o) \
106 $(CFILES:.c=.o) \
107 $(LFILES:.l=.o) \
108 $(YFILES:%.y=%.tab.o)
109
2bd0ea18 110INSTALL = $(TOPDIR)/install-sh -o root -g root
f937adac
NS
111
112SHELL = /bin/sh
113IMAGES_DIR = $(TOPDIR)/all-images
114DIST_DIR = $(TOPDIR)/dist
2bd0ea18
NS
115
116CCF = $(CC) $(CFLAGS)
117MAKEF = $(MAKE) $(MAKEOPTS)
118CXXF = $(CXX) $(CXXFLAGS)
119LDF = $(LD) $(LDFLAGS)
2bd0ea18 120
f937adac
NS
121# For libtool. Pieces from Automake, slightly modified.
122top_builddir = $(TOPDIR)
123DIRT += $(LTOBJECTS) $(LTLIBRARY)
124LTLINK = $(LIBTOOL) --mode=link $(CC)
125LTEXEC = $(LIBTOOL) --mode=execute
126LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) -D_REENTRANT
127LTVERSION = $(LT_CURRENT).$(LT_REVISION).$(LT_AGE)
128LTOBJECTS = $(OBJECTS:.o=.lo)
129ifeq ($(ENABLE_SHARED),yes)
130LTLDFLAGS += -rpath $(PKG_LIB_DIR)
131LTLDFLAGS += -version-info $(subst .,:,$(LTVERSION))
132endif
133LIBNAME = $(basename $(LTLIBRARY))
134
135ifeq ($(ENABLE_SHARED),yes)
136INSTALL_LTLIB = \
137 cd $(TOPDIR)/$(LIBNAME)/.libs; \
138 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
139 ../$(INSTALL) -m 644 $(LIBNAME).so.$(LTVERSION) $(PKG_LIB_DIR); \
140 test "$(PKG_DISTRIBUTION)" = debian || \
141 ../$(INSTALL) -S $(LIBNAME).so.$(LTVERSION) $(PKG_LIB_DIR)/$(LIBNAME).so.$(LT_CURRENT)
142endif
2bd0ea18 143
f937adac
NS
144ifeq ($(ENABLE_SHARED),yes)
145INSTALL_LTLIB_DEV = \
146 cd $(TOPDIR)/$(LIBNAME)/.libs; \
147 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
148 ../$(INSTALL) -m 644 $(LIBNAME).a $(PKG_LIB_DIR); \
149 ../$(INSTALL) -S $(LIBNAME).so.$(LT_CURRENT) $(PKG_LIB_DIR)/$(LIBNAME).so
150else
151INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
152endif
2bd0ea18 153
f937adac
NS
154INSTALL_LTLIB_STATIC = \
155 cd $(TOPDIR)/$(LIBNAME)/.libs; \
156 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
157 ../$(INSTALL) -m 644 $(LIBNAME).a $(PKG_LIB_DIR)
2bd0ea18
NS
158
159INSTALL_MAN = \
160 @for d in $(MAN_PAGES); do \
161 first=true; \
162 for m in `$(AWK) '/^\.SH NAME/ {ok=1; next} ok {print; exit}' $$d \
163 | sed -e 's/,/ /g' -e 's/\\-.*//' -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \
164 do \
165 [ -z "$$m" -o "$$m" = "\\" ] && continue; \
166 t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
167 if $$first; then \
168 if $(HAVE_ZIPPED_MANPAGES); then \
169 $(ZIP) --best -c $$d > $$d.gz; _sfx=.gz; \
170 fi; \
171 u=$$m.$(MAN_SECTION)$$_sfx; \
172 echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
173 $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
174 else \
175 echo $(INSTALL) -S $$u $${t}$$_sfx; \
176 $(INSTALL) -S $$u $${t}$$_sfx; \
177 fi; \
178 first=false; \
179 done; \
180 done
181
f937adac
NS
182SUBDIRS_MAKERULE = \
183 @for d in $(SUBDIRS) ""; do \
184 if test -d "$$d" -a ! -z "$$d"; then \
185 $(ECHO) === $$d ===; \
186 $(MAKEF) -C $$d $@ || exit $$?; \
187 fi; \
188 done
189
190MAN_MAKERULE = \
191 @for f in *.[12345678] ""; do \
192 if test ! -z "$$f"; then \
193 $(ZIP) --best -c < $$f > $$f.gz; \
194 fi; \
195 done
196
2bd0ea18
NS
197DIST_MAKERULE = \
198 $(MAKEF) -C build dist
199
200SOURCE_MAKERULE = \
201 @test -z "$$DIR" && DIR="."; \
202 for f in $(SRCFILES) ""; do \
203 if test ! -z "$$f"; then $(ECHO) $$DIR/$$f; fi;\
204 done; \
205 for d in `echo $(SUBDIRS)` ; do \
206 if test -d "$$d" -a ! -z "$$d"; then \
207 $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \
208 fi; \
209 done
210
211endif
212
213#
214# For targets that should always be rebuilt,
215# define a target that is never up-to-date.
216# Targets needing this should depend on $(_FORCE)
217_FORCE = __force_build