]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | # |
e80aa729 | 2 | # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 3 | # |
2bd0ea18 NS |
4 | |
5 | TOPDIR = .. | |
6 | include $(TOPDIR)/include/builddefs | |
7 | ||
f937adac NS |
8 | LTLIBRARY = libxfs.la |
9 | LT_CURRENT = 0 | |
10 | LT_REVISION = 0 | |
11 | LT_AGE = 0 | |
fc49813f | 12 | |
636b4d91 DC |
13 | # headers to install in include/xfs |
14 | PKGHFILES = xfs_fs.h \ | |
5711848a | 15 | xfs_types.h \ |
77d98709 CH |
16 | xfs_da_format.h \ |
17 | xfs_format.h \ | |
18 | xfs_log_format.h | |
19 | ||
6b803e5a | 20 | HFILES = \ |
77d98709 | 21 | xfs_alloc.h \ |
636b4d91 DC |
22 | xfs_alloc_btree.h \ |
23 | xfs_attr_leaf.h \ | |
24 | xfs_attr_sf.h \ | |
25 | xfs_bit.h \ | |
26 | xfs_bmap.h \ | |
27 | xfs_bmap_btree.h \ | |
28 | xfs_btree.h \ | |
29 | xfs_attr_remote.h \ | |
30 | xfs_cksum.h \ | |
31 | xfs_da_btree.h \ | |
636b4d91 | 32 | xfs_dir2.h \ |
636b4d91 DC |
33 | xfs_ialloc.h \ |
34 | xfs_ialloc_btree.h \ | |
35 | xfs_inode_buf.h \ | |
36 | xfs_inode_fork.h \ | |
636b4d91 DC |
37 | xfs_quota_defs.h \ |
38 | xfs_sb.h \ | |
39 | xfs_shared.h \ | |
40 | xfs_trans_resv.h \ | |
b626fb59 | 41 | xfs_trans_space.h \ |
e515cca1 | 42 | libxfs_io.h \ |
6b803e5a CH |
43 | libxfs_api_defs.h \ |
44 | init.h \ | |
77d98709 CH |
45 | crc32defs.h \ |
46 | crc32table.h \ | |
47 | libxfs_priv.h \ | |
48 | xfs_dir2_priv.h | |
49 | ||
4896e6c8 DC |
50 | CFILES = cache.c \ |
51 | crc32.c \ | |
4071f725 DC |
52 | init.c \ |
53 | kmem.c \ | |
54 | logitem.c \ | |
55 | radix-tree.c \ | |
56 | rdwr.c \ | |
57 | trans.c \ | |
58 | util.c \ | |
5d90ab5a DC |
59 | xfs_alloc.c \ |
60 | xfs_alloc_btree.c \ | |
4896e6c8 | 61 | xfs_attr.c \ |
88cd79be | 62 | xfs_attr_leaf.c \ |
4896e6c8 | 63 | xfs_attr_remote.c \ |
4071f725 | 64 | xfs_bit.c \ |
88cd79be DC |
65 | xfs_bmap.c \ |
66 | xfs_bmap_btree.c \ | |
5d90ab5a | 67 | xfs_btree.c \ |
88cd79be | 68 | xfs_da_btree.c \ |
ff105f75 | 69 | xfs_da_format.c \ |
88cd79be DC |
70 | xfs_dir2.c \ |
71 | xfs_dir2_block.c \ | |
72 | xfs_dir2_data.c \ | |
73 | xfs_dir2_leaf.c \ | |
74 | xfs_dir2_node.c \ | |
75 | xfs_dir2_sf.c \ | |
32390f05 | 76 | xfs_dquot_buf.c \ |
5d90ab5a | 77 | xfs_ialloc.c \ |
1d519883 | 78 | xfs_inode_buf.c \ |
5d90ab5a | 79 | xfs_inode_fork.c \ |
88cd79be DC |
80 | xfs_ialloc_btree.c \ |
81 | xfs_log_rlimit.c \ | |
2ceff9ce | 82 | xfs_rtbitmap.c \ |
4896e6c8 | 83 | xfs_sb.c \ |
270b1db1 | 84 | xfs_symlink_remote.c \ |
364e85ec | 85 | xfs_trans_resv.c |
9440d84d NS |
86 | |
87 | CFILES += $(PKG_PLATFORM).c | |
1707056a | 88 | PCFILES = darwin.c freebsd.c irix.c linux.c |
93d9f139 | 89 | LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g") |
7e280e68 | 90 | LSRCFILES += gen_crc32table.c |
2bd0ea18 | 91 | |
dfc130f3 | 92 | # |
2bd0ea18 NS |
93 | # Tracing flags: |
94 | # -DIO_DEBUG reads and writes of buffers | |
95 | # -DMEM_DEBUG all zone memory use | |
96 | # -DLI_DEBUG log item (ino/buf) manipulation | |
97 | # -DXACT_DEBUG transaction state changes | |
dfc130f3 | 98 | # |
8d9f1b15 | 99 | #LCFLAGS += |
1bdd986b NS |
100 | |
101 | FCFLAGS = -I. | |
2bd0ea18 | 102 | |
717e6142 AM |
103 | LTLIBS = $(LIBPTHREAD) $(LIBRT) |
104 | ||
fc49813f NS |
105 | # don't try linking xfs_repair with a debug libxfs. |
106 | DEBUG = -DNDEBUG | |
107 | ||
7e280e68 DC |
108 | LDIRT = gen_crc32table crc32table.h crc32selftest |
109 | ||
337d9a24 | 110 | default: crc32selftest ltdepend $(LTLIBRARY) |
7e280e68 DC |
111 | |
112 | crc32table.h: gen_crc32table.c | |
113 | @echo " [CC] gen_crc32table" | |
e14913c1 | 114 | $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $< |
7e280e68 DC |
115 | @echo " [GENERATE] $@" |
116 | $(Q) ./gen_crc32table > crc32table.h | |
117 | ||
118 | # The selftest binary will return an error if it fails. This is made a | |
119 | # dependency of the build process so that we refuse to build the tools on broken | |
120 | # systems/architectures. Hence we make sure that xfsprogs will never use a | |
121 | # busted CRC calculation at build time and hence avoid putting bad CRCs down on | |
122 | # disk. | |
123 | crc32selftest: gen_crc32table.c crc32table.h crc32.c | |
124 | @echo " [TEST] CRC32" | |
e14913c1 | 125 | $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ |
7e280e68 | 126 | $(Q) ./$@ |
2bd0ea18 | 127 | |
636b4d91 | 128 | # set up include/xfs header directory |
2bd0ea18 NS |
129 | include $(BUILDRULES) |
130 | ||
131 | install: default | |
b08338d7 DC |
132 | $(INSTALL) -m 755 -d $(PKG_INC_DIR) |
133 | ||
6b803e5a | 134 | install-headers: $(addsuffix -hdrs, $(PKGHFILES)) |
b08338d7 DC |
135 | |
136 | %-hdrs: | |
137 | $(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$* | |
fc49813f | 138 | |
636b4d91 | 139 | install-dev: install |
61e2fa77 | 140 | $(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR) |
5e656dbb | 141 | |
b08338d7 DC |
142 | # We need to install the headers before building the dependencies. If we |
143 | # include the .ltdep file, the makefile decides that it needs to build the | |
144 | # dependencies to remake the makefile before running the header install target, | |
145 | # hence making it impossible to avoid errors being thrown by the dependency | |
146 | # generation. Hence we play games so that we only include this file if we aren't | |
147 | # running the install-headers target. | |
148 | ifndef NODEP | |
932b0ba9 | 149 | -include .ltdep |
b08338d7 | 150 | endif |
636b4d91 | 151 |