LDIRT += $(SRCTAR)
endif
-LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk
+
+DLIB_SUBDIRS = libxlog libxcmd libhandle libdisk
+LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS)
TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \
mdrestore repair rtcp m4 man doc po debian
endif
# tool/lib dependencies
+# note: include/xfs is set up by libxfs, too, so everything is dependent on it.
$(LIB_SUBDIRS) $(TOOL_SUBDIRS): include
-copy mdrestore: libxfs
-db logprint: libxfs libxlog
+$(DLIB_SUBDIRS) $(TOOL_SUBDIRS): libxfs
+db logprint: libxlog
fsr: libhandle
-growfs: libxfs libxcmd
+growfs: libxcmd
io: libxcmd libhandle
-mkfs: libxfs
quota: libxcmd
-repair: libxfs libxlog
+repair: libxlog
+
ifneq ($(ENABLE_BLKID), yes)
mkfs: libdisk
QAHFILES = libxfs.h libxlog.h \
atomic.h bitops.h cache.h kmem.h list.h hlist.h parent.h radix-tree.h \
swab.h \
- xfs_ag.h xfs_alloc.h xfs_alloc_btree.h xfs_arch.h xfs_attr_leaf.h \
- xfs_attr_sf.h xfs_bit.h xfs_bmap.h xfs_bmap_btree.h xfs_btree.h \
- xfs_attr_remote.h \
+ xfs_arch.h \
xfs_btree_trace.h \
- xfs_cksum.h \
- xfs_da_btree.h \
- xfs_da_format.h \
- xfs_dinode.h \
- xfs_dir2.h \
- xfs_format.h \
- xfs_ialloc.h \
- xfs_ialloc_btree.h \
- xfs_inode_buf.h \
- xfs_inode_fork.h \
- xfs_inum.h \
- xfs_log_format.h \
xfs_log_recover.h \
xfs_metadump.h \
- xfs_quota_defs.h \
- xfs_sb.h \
- xfs_shared.h \
- xfs_trace.h \
- xfs_trans_resv.h \
- xfs_trans_space.h
+ xfs_trace.h
-HFILES = handle.h jdm.h xqm.h xfs.h xfs_fs.h xfs_types.h
+HFILES = handle.h jdm.h xqm.h xfs.h
HFILES += $(PKG_PLATFORM).h
PHFILES = darwin.h freebsd.h irix.h linux.h gnukfreebsd.h
DKHFILES = volume.h fstyp.h dvh.h
+LIBHFILES = command.h input.h path.h project.h
LSRCFILES = $(shell echo $(PHFILES) | sed -e "s/$(PKG_PLATFORM).h//g")
LSRCFILES += platform_defs.h.in builddefs.in buildmacros buildrules install-sh
-LSRCFILES += $(DKHFILES) command.h input.h path.h project.h
-LDIRT = xfs disk
+LSRCFILES += $(DKHFILES) $(LIBHFILES)
+LDIRT = disk
+LDIRDIRT = xfs
-default install: xfs disk
+default install: .xfs disk
-xfs disk:
+disk:
@echo " [LN] $@"
$(Q)$(LN_S) . $@
+# set up include/xfs header directory
+.xfs: $(addsuffix -hdrs, $(HFILES) $(QAHFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
+
+%-hdrs: xfs
+ $(Q)$(LN_S) -f $(PWD)/include/$* xfs/$*
+
+xfs:
+ @mkdir -p xfs
+
+
include $(BUILDRULES)
install-dev: default
install-qa: install-dev
$(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
+
ltdepend: rmltdep .ltdep
rmltdep:
- @rm -f .ltdep
+ $(Q)rm -f .ltdep
.ltdep: $(CFILES) $(HFILES)
$(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
depend: rmdep .dep
rmdep:
- @rm -f .dep
+ $(Q)rm -f .dep
.dep: $(CFILES) $(HFILES)
$(Q)$(MAKEDEP) $(CFILES) > .dep
LT_REVISION = 0
LT_AGE = 0
-HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h crc32table.h
+# headers to install in include/xfs
+PKGHFILES = xfs_fs.h \
+ xfs_types.h
+
+# headers with build dependencies
+HFILES = xfs.h \
+ init.h \
+ crc32defs.h \
+ crc32table.h \
+ xfs_dir2_priv.h \
+
+# headers installed in QA targets
+QAHFILES = xfs_ag.h \
+ xfs_alloc.h \
+ xfs_alloc_btree.h \
+ xfs_attr_leaf.h \
+ xfs_attr_sf.h \
+ xfs_bit.h \
+ xfs_bmap.h \
+ xfs_bmap_btree.h \
+ xfs_btree.h \
+ xfs_attr_remote.h \
+ xfs_cksum.h \
+ xfs_da_btree.h \
+ xfs_da_format.h \
+ xfs_dinode.h \
+ xfs_dir2.h \
+ xfs_format.h \
+ xfs_ialloc.h \
+ xfs_ialloc_btree.h \
+ xfs_inode_buf.h \
+ xfs_inode_fork.h \
+ xfs_inum.h \
+ xfs_log_format.h \
+ xfs_quota_defs.h \
+ xfs_sb.h \
+ xfs_shared.h \
+ xfs_trans_resv.h \
+ xfs_trans_space.h
+
CFILES = cache.c \
crc32.c \
init.c kmem.c logitem.c radix-tree.c rdwr.c trans.c util.c \
LDIRT = gen_crc32table crc32table.h crc32selftest
-default: crc32selftest ltdepend $(LTLIBRARY)
+default: xfs crc32selftest ltdepend $(LTLIBRARY)
crc32table.h: gen_crc32table.c
@echo " [CC] gen_crc32table"
$(Q) $(CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
$(Q) ./$@
+# set up include/xfs header directory
+xfs: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
+
+%-hdrs:
+ $(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
+
include $(BUILDRULES)
install: default
-install-dev: default
+install-dev: install
+ $(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR)
-install-qa: default
+install-qa: install-dev
+ $(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
-include .ltdep
+