1srcdir = .
2top_srcdir = .
3
4top_builddir = .
5my_dir = .
6INSTALL = /usr/bin/install -c
7
8# Beginning of file MCONFIG
9
10all::
11
12check::
13
14SHELL = /bin/sh
15
16COMPRESS_EXT = gz bz2 bz Z
17
18prefix = /usr
19root_prefix = 
20exec_prefix = ${prefix}
21root_bindir = ${root_prefix}/bin
22root_sbindir = ${root_prefix}/sbin
23root_libdir = ${root_prefix}/lib
24datarootdir = ${prefix}/share
25bindir = ${exec_prefix}/bin
26sbindir = ${exec_prefix}/sbin
27libdir = ${exec_prefix}/lib
28datadir= ${datarootdir}
29localedir = $(datadir)/locale
30root_sysconfdir= ${root_prefix}/etc
31includedir = ${prefix}/include
32mandir = ${datarootdir}/man
33man1dir = $(mandir)/man1
34man3dir = $(mandir)/man3
35man5dir = $(mandir)/man5
36man8dir = $(mandir)/man8
37infodir = ${datarootdir}/info
38datadir = ${datarootdir}
39
40
41
42CROSS_COMPILER = mipsel-linux-
43CC = $(CROSS_COMPILER)gcc
44BUILD_CC = $(CC)
45DEFS = -DLOCALEDIR=\"$(localedir)\" -DROOT_SYSCONFDIR=\"$(root_sysconfdir)\" -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DENABLE_HTREE=1 -DENABLE_SWAPFS=1 -DTLS= -DUSE_UUIDD=1 -DPACKAGE=\"e2fsprogs\" -DVERSION=\"0.14.1\" -DHAVE_LONG_LONG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_WCHAR_T=1 -DHAVE_WINT_T=1 -DHAVE_INTTYPES_H_WITH_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FCHOWN=1 -DHAVE_MALLINFO=1 -DHAVE_FDATASYNC=1 -DHAVE_STRNLEN=1 -DHAVE_STRPTIME=1 -DHAVE_STRDUP=1 -DHAVE_SYSCONF=1 -DHAVE_PATHCONF=1 -DHAVE_POSIX_MEMALIGN=1 -DHAVE_MEMALIGN=1 -DHAVE_VALLOC=1 -DHAVE___SECURE_GETENV=1 -DHAVE_PRCTL=1 -DHAVE_MMAP=1 -DHAVE_UTIME=1 -DHAVE_SETRESUID=1 -DHAVE_SETRESGID=1 -DHAVE_DLOPEN=1 -DHAVE_EXT2_IOCTLS=1
46CFLAGS = -g -O2
47CPPFLAGS =  -I$(top_builddir)/lib -I$(top_srcdir)/lib 
48INTL_FLAGS = 
49ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS) \
50	$(INTL_FLAGS) $(LINUX_INCLUDE) 
51LDFLAGS = 
52ALL_LDFLAGS = $(LDFLAGS)
53BUILD_CFLAGS = -g -O2
54BUILD_LDFLAGS = 
55RM = /bin/rm
56LN = /bin/ln
57LN_S = ln -s
58MV = /bin/mv
59CP = /bin/cp
60CHMOD = /bin/chmod
61AR = $(CROSS_COMPILER)ar
62AWK = gawk
63SED = /bin/sed
64PERL = /usr/bin/perl
65RANLIB = $(CROSS_COMPILER)ranlib
66STRIP = $(CROSS_COMPILER)strip
67LD = $(PURE) $(CC)
68ARUPD = $(AR) r
69ARGEN = $(AR) rc
70LDCONFIG = /sbin/ldconfig
71INSTALL_PROGRAM = ${INSTALL}
72INSTALL_DATA = ${INSTALL} -m 644
73INSTALL_SCRIPT = ${INSTALL}
74MKINSTALLDIRS = $(top_builddir)/config/mkinstalldirs
75
76#
77# Library definitions
78#
79DEVMAPPER_LIBS = 
80STATIC_DEVMAPPER_LIBS = 
81
82LIB = $(top_builddir)/lib
83LIBSS = $(LIB)/libss.a
84LIBCOM_ERR = $(LIB)/libcom_err.a
85LIBE2P = $(LIB)/libe2p.a
86LIBEXT2FS = $(LIB)/libext2fs.a
87LIBUUID = $(LIB)/libuuid.a 
88LIBBLKID = $(LIB)/libblkid.a 
89LIBINTL = 
90DEPLIBUUID = $(LIB)/libuuid.a
91DEPLIBBLKID = $(LIB)/libblkid.a
92
93STATIC_LIBSS = $(LIB)/libss.a
94STATIC_LIBCOM_ERR = $(LIB)/libcom_err.a
95STATIC_LIBE2P = $(LIB)/libe2p.a
96STATIC_LIBEXT2FS = $(LIB)/libext2fs.a
97STATIC_LIBUUID = $(LIB)/libuuid.a  
98STATIC_LIBBLKID = $(LIB)/libblkid.a $(STATIC_DEVMAPPER_LIBS)
99DEPSTATIC_LIBUUID = $(LIB)/libuuid.a
100DEPSTATIC_LIBBLKID = $(LIB)/libblkid.a
101
102PROFILED_LIBSS = $(LIB)/libss
103PROFILED_LIBCOM_ERR = $(LIB)/libcom_err
104PROFILED_LIBE2P = $(LIB)/libe2p
105PROFILED_LIBEXT2FS = $(LIB)/libext2fs
106PROFILED_LIBUUID = $(LIB)/libuuid  
107PROFILED_LIBBLKID = $(LIB)/libblkid
108DEPPROFILED_LIBUUID = $(LIB)/libuuid
109DEPPROFILED_LIBBLKID = $(LIB)/libblkid
110
111# An include directive pointing to a directory holding enough linux-like
112# include files to satisfy some programs here
113LINUX_INCLUDE=
114
115#
116# A fast substitution command for fixing up man pages, shell scripts, etc.
117#
118SUBST_CONF=$(top_builddir)/util/subst.conf
119SUBSTITUTE= $(top_builddir)/util/subst -f $(SUBST_CONF)
120SUBSTITUTE_UPTIME= $(top_builddir)/util/subst -t -f $(SUBST_CONF)
121DEP_SUBSTITUTE= $(top_builddir)/util/subst $(SUBST_CONF)
122
123$(top_builddir)/util/subst:
124	cd $(top_builddir)/util ; $(MAKE) subst
125
126#
127# Warning flags
128#
129# Run make gcc-wall to do a build with warning messages.
130#
131#
132WFLAGS=		-std=c99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE \
133			-pedantic $(WFLAGS_EXTRA) \
134			-Wall -W -Wwrite-strings -Wpointer-arith \
135			-Wcast-qual -Wcast-align -Wno-variadic-macros \
136			-Wstrict-prototypes -Wmissing-prototypes \
137			-Wformat-security  -Wformat-nonliteral \
138			-Wmissing-format-attribute -O2 -Wstrict-aliasing \
139			-Wnested-externs -Winline -DNO_INLINE_FUNCS -Wshadow \
140			-UENABLE_NLS
141
142gcc-wall-new:
143	(make USE_WFLAGS="$(WFLAGS)" > /dev/null) 2>&1 | sed -f $(top_srcdir)/util/gcc-wall-cleanup 
144
145gcc-wall:
146	make clean > /dev/null
147	make gcc-wall-new
148
149#
150# Installation user and groups
151#
152BINGRP=		bin
153BINOWN=		bin
154BINMODE=	555
155INCGRP=		bin
156INCOWN=		bin
157INCMODE=	444
158LIBOWN=		bin
159LIBGRP=		bin
160LIBMODE=	444
161MANGRP=		bin
162MANOWN=		bin
163MANMODE=	444
164
165#
166# Autoconf magic...
167#
168
169DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.elf-lib  \
170	$(top_srcdir)/lib/Makefile.bsd-lib $(top_srcdir)/lib/Makefile.darwin-lib \
171	$(top_srcdir)/lib/Makefile.solaris-lib $(top_srcdir)/lib/Makefile.checker \
172	$(top_srcdir)/lib/Makefile.profile
173
174$(top_builddir)/config.status: $(top_srcdir)/configure
175	cd $(top_builddir); ./config.status --recheck
176
177$(top_builddir)/MCONFIG: $(top_srcdir)/MCONFIG.in $(top_builddir)/config.status
178	cd $(top_builddir); CONFIG_FILES=MCONFIG ./config.status
179
180$(top_builddir)/lib/substitute_sh: $(top_srcdir)/lib/substitute_sh.in \
181		$(top_builddir)/config.status
182	cd $(top_builddir); CONFIG_FILES=lib/substitute_sh ./config.status
183
184$(top_builddir)/util/subst.conf: $(top_srcdir)/util/subst.conf.in \
185		$(top_builddir)/config.status
186	cd $(top_builddir); CONFIG_FILES=util/subst.conf ./config.status
187
188Makefile: $(srcdir)/Makefile.in $(top_builddir)/MCONFIG \
189		$(DEP_MAKEFILE) $(top_builddir)/config.status
190	cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
191
192#$(top_srcdir)/configure: $(top_srcdir)/configure.in
193#	cd $(top_srcdir) && autoconf
194
195#
196# Make depend magic...
197#
198
199.depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
200	if test -n "$(SRCS)" ; then \
201		$(CC) -M $(ALL_CFLAGS) $(SRCS) | \
202			$(SED) -f $(top_srcdir)/depfix.sed \
203			    -e 's; $(srcdir)/; $$(srcdir)/;g' \
204			    -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
205			    -e 's; $(top_builddir)/; $$(top_builddir)/;g' \
206			    -e 's; \./; ;g' \
207			    -e '/^#/d' \
208			    -e '/^ *\\$$/d' | \
209			$(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
210	else :; fi
211
212depend:: .depend
213	if test -n "$(SRCS)" ; then \
214		sed -e '/^# +++ Dependency line eater +++/,$$d' \
215			< $(srcdir)/Makefile.in | cat - .depend \
216			> $(srcdir)/Makefile.in.new; \
217	if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
218		$(RM) $(srcdir)/Makefile.in.new ; \
219	else \
220		$(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
221		$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
222	fi ; else :; fi
223
224# End of file MCONFIG
225
226RESIZE_DIR= resize
227DEBUGFS_DIR= debugfs
228
229LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid lib/blkid intl
230PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
231SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
232
233SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
234
235TAR=tar
236
237all:: subs
238	$(MAKE) libs
239	$(MAKE) progs
240	$(MAKE) docs
241
242subs:
243	@for i in $(SUBS) ; do if test -d `dirname $$i` ; then $(MAKE) $$i ; fi ; done
244
245progs: subs all-progs-recursive
246libs: subs all-libs-recursive
247
248e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
249	cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
250
251rpm: e2fsprogs.spec
252	sh contrib/build-rpm
253
254docs:
255	-@test -d doc && cd doc && $(MAKE) libext2fs.info
256
257install-doc-libs:
258	-@test -d doc && cd doc && $(MAKE) install-doc-libs
259
260uninstall-doc-libs:
261	-@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
262
263clean-doc:
264	-@test -d doc && cd doc && $(MAKE) clean
265
266distclean-doc:
267	-test -d doc && cd doc && $(MAKE) distclean
268
269#install: subs all-libs-recursive install-progs-recursive install-shlibs-libs-recursive install-doc-libs
270#	if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
271
272install: libs progs
273	install -D misc/mke2fs ${INSTALLDIR}/usr/sbin/mke2fs
274
275install-strip: subs all-libs-recursive install-strip-progs-recursive \
276  install-shlibs-strip-libs-recursive install-doc-libs
277
278uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
279
280install-libs: install-libs-recursive
281
282uninstall-libs: uninstall-libs-recursive
283
284TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
285  mostlyclean-recursive realclean-recursive:
286	@for subdir in $(SUBDIRS); do \
287	  if test -d $$subdir ; then \
288	    target=`echo $@|$(SED) 's/-recursive//'`; \
289	    echo making $$target in $$subdir; \
290	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
291	  fi ; \
292	done
293
294all-progs-recursive install-progs-recursive install-strip-progs-recursive \
295  uninstall-progs-recursive: all-libs-recursive
296	@for subdir in $(PROG_SUBDIRS); do \
297	  if test -d $$subdir ; then \
298	    target=`echo $@|$(SED) 's/-progs-recursive//'`; \
299	    echo making $$target in $$subdir; \
300	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
301	  fi ; \
302	done
303
304all-libs-recursive install-libs-recursive install-strip-libs-recursive \
305  uninstall-libs-recursive install-shlibs-libs-recursive \
306  install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
307	@for subdir in $(LIB_SUBDIRS); do \
308	  if test -d $$subdir ; then \
309	    target=`echo $@|$(SED) 's/-libs-recursive//'`; \
310	    echo making $$target in $$subdir; \
311	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
312	  fi ; \
313	done
314
315mostlyclean: mostlyclean-recursive mostlyclean-local
316
317clean: clean-recursive clean-local clean-doc
318	$(RM) -f $(SUBS) 
319
320distclean: distclean-doc distclean-recursive
321	$(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
322	$(MAKE) distclean-local 
323
324realclean: realclean-recursive realclean-local
325
326depend:: depend-recursive
327
328lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
329		$(srcdir)/lib/ext2fs/ext2_types.h.in
330	cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
331
332lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
333		$(srcdir)/lib/blkid/blkid_types.h.in
334	cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
335
336lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
337		$(srcdir)/lib/uuid/uuid_types.h.in
338	cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
339
340mostlyclean-local:
341	$(RM) -f \#* *~ *.orig core MAKELOG 
342
343clean-local: mostlyclean-local
344
345distclean-local: clean-local
346	$(RM) -f $(SUBS) $(SUBST_CONF) \
347		config.status config.log config.cache MCONFIG Makefile \
348		$(srcdir)/TAGS $(srcdir)/Makefile.in.old
349
350realclean-local: distclean-local
351	$(RM) -f configure
352
353check::	subs check-recursive
354
355