]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libxfs/Makefile
libxfs: disambiguate xfs.h
[thirdparty/xfsprogs-dev.git] / libxfs / Makefile
1 #
2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
3 #
4
5 TOPDIR = ..
6 include $(TOPDIR)/include/builddefs
7
8 LTLIBRARY = libxfs.la
9 LT_CURRENT = 0
10 LT_REVISION = 0
11 LT_AGE = 0
12
13 # headers to install in include/xfs
14 PKGHFILES = xfs_fs.h \
15 xfs_types.h
16
17 # headers with build dependencies
18 HFILES = init.h \
19 crc32defs.h \
20 crc32table.h \
21 libxfs_priv.h \
22 xfs_dir2_priv.h \
23
24 # headers installed in QA targets
25 QAHFILES = xfs_alloc.h \
26 xfs_alloc_btree.h \
27 xfs_attr_leaf.h \
28 xfs_attr_sf.h \
29 xfs_bit.h \
30 xfs_bmap.h \
31 xfs_bmap_btree.h \
32 xfs_btree.h \
33 xfs_attr_remote.h \
34 xfs_cksum.h \
35 xfs_da_btree.h \
36 xfs_da_format.h \
37 xfs_dir2.h \
38 xfs_format.h \
39 xfs_ialloc.h \
40 xfs_ialloc_btree.h \
41 xfs_inode_buf.h \
42 xfs_inode_fork.h \
43 xfs_log_format.h \
44 xfs_quota_defs.h \
45 xfs_sb.h \
46 xfs_shared.h \
47 xfs_trans_resv.h \
48 xfs_trans_space.h \
49 libxfs_io.h
50
51 CFILES = cache.c \
52 crc32.c \
53 init.c kmem.c logitem.c radix-tree.c rdwr.c trans.c util.c \
54 xfs_alloc.c \
55 xfs_alloc_btree.c \
56 xfs_attr.c \
57 xfs_attr_leaf.c \
58 xfs_attr_remote.c \
59 xfs_bmap.c \
60 xfs_bmap_btree.c \
61 xfs_btree.c \
62 xfs_da_btree.c \
63 xfs_da_format.c \
64 xfs_dir2.c \
65 xfs_dir2_block.c \
66 xfs_dir2_data.c \
67 xfs_dir2_leaf.c \
68 xfs_dir2_node.c \
69 xfs_dir2_sf.c \
70 xfs_dquot_buf.c \
71 xfs_ialloc.c \
72 xfs_inode_buf.c \
73 xfs_inode_fork.c \
74 xfs_ialloc_btree.c \
75 xfs_log_rlimit.c \
76 xfs_rtbitmap.c \
77 xfs_sb.c \
78 xfs_symlink_remote.c \
79 xfs_trans_resv.c
80
81 CFILES += $(PKG_PLATFORM).c
82 PCFILES = darwin.c freebsd.c irix.c linux.c
83 LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
84 LSRCFILES += gen_crc32table.c
85
86 #
87 # Tracing flags:
88 # -DIO_DEBUG reads and writes of buffers
89 # -DMEM_DEBUG all zone memory use
90 # -DLI_DEBUG log item (ino/buf) manipulation
91 # -DXACT_DEBUG transaction state changes
92 #
93 #LCFLAGS +=
94
95 FCFLAGS = -I.
96
97 LTLIBS = $(LIBPTHREAD) $(LIBRT)
98
99 # don't try linking xfs_repair with a debug libxfs.
100 DEBUG = -DNDEBUG
101
102 LDIRT = gen_crc32table crc32table.h crc32selftest
103
104 default: xfs crc32selftest ltdepend $(LTLIBRARY)
105
106 crc32table.h: gen_crc32table.c
107 @echo " [CC] gen_crc32table"
108 $(Q) $(CC) $(CFLAGS) -o gen_crc32table $<
109 @echo " [GENERATE] $@"
110 $(Q) ./gen_crc32table > crc32table.h
111
112 # The selftest binary will return an error if it fails. This is made a
113 # dependency of the build process so that we refuse to build the tools on broken
114 # systems/architectures. Hence we make sure that xfsprogs will never use a
115 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
116 # disk.
117 crc32selftest: gen_crc32table.c crc32table.h crc32.c
118 @echo " [TEST] CRC32"
119 $(Q) $(CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
120 $(Q) ./$@
121
122 # set up include/xfs header directory
123 xfs: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
124
125 %-hdrs:
126 $(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
127
128 include $(BUILDRULES)
129
130 install: default
131
132 install-dev: install
133 $(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR)
134
135 install-qa: install-dev
136 $(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
137
138 -include .ltdep
139