]>
Commit | Line | Data |
---|---|---|
1 | srcdir = @srcdir@ | |
2 | top_srcdir = @top_srcdir@ | |
3 | VPATH = @srcdir@ | |
4 | top_builddir = . | |
5 | my_dir = . | |
6 | INSTALL = @INSTALL@ | |
7 | ||
8 | CHECK=sparse | |
9 | CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null | |
10 | ifeq ("$(C)", "2") | |
11 | CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__ | |
12 | else | |
13 | ifeq ("$(C)", "1") | |
14 | CHECK_CMD=$(CHECK) $(CHECK_OPTS) | |
15 | else | |
16 | CHECK_CMD=@true | |
17 | endif | |
18 | endif | |
19 | export CHECK_CMD | |
20 | ||
21 | @MCONFIG@ | |
22 | ||
23 | % : %.sh | |
24 | ||
25 | @RESIZER_CMT@RESIZE_DIR= resize | |
26 | @DEBUGFS_CMT@DEBUGFS_DIR= debugfs | |
27 | @UUID_CMT@UUID_LIB_SUBDIR= lib/uuid | |
28 | @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid | |
29 | QUOTA_LIB_SUBDIR= lib/quota | |
30 | ||
31 | LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl | |
32 | PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po | |
33 | SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests | |
34 | ||
35 | SUBS= util/subst.conf lib/config.h lib/dirpaths.h \ | |
36 | lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h | |
37 | ||
38 | TAR=tar | |
39 | ||
40 | all:: subs | |
41 | $(MAKE) libs | |
42 | $(MAKE) progs | |
43 | $(MAKE) docs | |
44 | ||
45 | subs: $(DEP_SUBSTITUTE) | |
46 | @for i in $(SUBS) ; do if test -d `dirname $$i` ; \ | |
47 | then $(MAKE) $$i || exit $$? ; fi ; done | |
48 | @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi) | |
49 | @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi) | |
50 | ||
51 | progs: all-progs-recursive | |
52 | libs: all-libs-recursive | |
53 | all-progs-recursive all-libs-recursive: subs | |
54 | ||
55 | e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in | |
56 | cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status | |
57 | ||
58 | rpm: e2fsprogs.spec | |
59 | sh contrib/build-rpm | |
60 | ||
61 | docs: | |
62 | -@test -d doc && cd doc && $(MAKE) libext2fs.info | |
63 | ||
64 | install-doc-libs: | |
65 | -@test -d doc && cd doc && $(MAKE) install-doc-libs | |
66 | ||
67 | uninstall-doc-libs: | |
68 | -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs | |
69 | ||
70 | clean-doc: | |
71 | -@test -d doc && cd doc && $(MAKE) clean | |
72 | ||
73 | distclean-doc: | |
74 | -test -d doc && cd doc && $(MAKE) distclean | |
75 | ||
76 | install: subs all-libs-recursive install-progs-recursive \ | |
77 | install-shlibs-libs-recursive install-doc-libs | |
78 | if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi | |
79 | ||
80 | install-strip: subs all-libs-recursive install-strip-progs-recursive \ | |
81 | install-shlibs-strip-libs-recursive install-doc-libs | |
82 | ||
83 | uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs | |
84 | ||
85 | install-libs: install-libs-recursive | |
86 | ||
87 | uninstall-libs: uninstall-libs-recursive | |
88 | ||
89 | check-recursive: all | |
90 | ||
91 | TAGS clean-recursive distclean-recursive depend-recursive check-recursive \ | |
92 | mostlyclean-recursive realclean-recursive: | |
93 | @for subdir in $(SUBDIRS); do \ | |
94 | if test -d $$subdir ; then \ | |
95 | target=`echo $@|$(SED) 's/-recursive//'`; \ | |
96 | echo making $$target in $$subdir; \ | |
97 | (cd $$subdir && $(MAKE) $$target) || exit 1; \ | |
98 | fi ; \ | |
99 | done | |
100 | ||
101 | all-progs-recursive install-progs-recursive install-strip-progs-recursive \ | |
102 | uninstall-progs-recursive: all-libs-recursive | |
103 | @for subdir in $(PROG_SUBDIRS); do \ | |
104 | if test -d $$subdir ; then \ | |
105 | target=`echo $@|$(SED) 's/-progs-recursive//'`; \ | |
106 | echo making $$target in $$subdir; \ | |
107 | (cd $$subdir && $(MAKE) $$target) || exit 1; \ | |
108 | fi ; \ | |
109 | done | |
110 | ||
111 | all-libs-recursive install-libs-recursive install-strip-libs-recursive \ | |
112 | uninstall-libs-recursive install-shlibs-libs-recursive \ | |
113 | install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive: | |
114 | @for subdir in $(LIB_SUBDIRS); do \ | |
115 | if test -d $$subdir ; then \ | |
116 | target=`echo $@|$(SED) 's/-libs-recursive//'`; \ | |
117 | echo making $$target in $$subdir; \ | |
118 | (cd $$subdir && $(MAKE) $$target) || exit 1; \ | |
119 | fi ; \ | |
120 | done | |
121 | ||
122 | mostlyclean: mostlyclean-recursive mostlyclean-local | |
123 | ||
124 | clean: clean-recursive clean-local clean-doc | |
125 | $(RM) -f $(SUBS) | |
126 | ||
127 | distclean: distclean-doc distclean-recursive | |
128 | $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po | |
129 | $(MAKE) distclean-local | |
130 | ||
131 | realclean: realclean-recursive realclean-local | |
132 | ||
133 | depend:: depend-recursive | |
134 | ||
135 | lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \ | |
136 | $(srcdir)/lib/ext2fs/ext2_types.h.in | |
137 | cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status | |
138 | ||
139 | lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \ | |
140 | $(srcdir)/lib/blkid/blkid_types.h.in | |
141 | cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status | |
142 | ||
143 | lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \ | |
144 | $(srcdir)/lib/uuid/uuid_types.h.in | |
145 | cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status | |
146 | ||
147 | mostlyclean-local: | |
148 | $(RM) -f \#* *~ *.orig core MAKELOG | |
149 | ||
150 | clean-local: mostlyclean-local | |
151 | ||
152 | distclean-local: clean-local | |
153 | $(RM) -f $(SUBS) $(SUBST_CONF) \ | |
154 | config.status config.log config.cache MCONFIG Makefile \ | |
155 | $(srcdir)/TAGS $(srcdir)/Makefile.in.old | |
156 | ||
157 | realclean-local: distclean-local | |
158 | $(RM) -f configure | |
159 | ||
160 | check:: all check-recursive | |
161 |