2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
6 include $(TOPDIR
)/include/builddefs
13 # headers to install in include/xfs
14 PKGHFILES
= xfs_fs.h \
41 xfs_refcount_btree.h \
94 xfs_refcount_btree.c \
99 xfs_symlink_remote.c \
102 CFILES
+= $(PKG_PLATFORM
).c
103 PCFILES
= darwin.c freebsd.c irix.c linux.c
104 LSRCFILES
= $(shell echo
$(PCFILES
) | sed
-e
"s/$(PKG_PLATFORM).c//g")
105 LSRCFILES
+= gen_crc32table.c
109 # -DIO_DEBUG reads and writes of buffers
110 # -DMEM_DEBUG all zone memory use
111 # -DLI_DEBUG log item (ino/buf) manipulation
112 # -DXACT_DEBUG transaction state changes
118 LTLIBS
= $(LIBPTHREAD
) $(LIBRT
)
120 # don't try linking xfs_repair with a debug libxfs.
123 LDIRT
= gen_crc32table crc32table.h crc32selftest
125 default
: crc32selftest ltdepend
$(LTLIBRARY
)
127 crc32table.h
: gen_crc32table.c crc32defs.h
128 @echo
" [CC] gen_crc32table"
129 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -o gen_crc32table
$<
130 @echo
" [GENERATE] $@"
131 $(Q
) .
/gen_crc32table
> crc32table.h
133 # The selftest binary will return an error if it fails. This is made a
134 # dependency of the build process so that we refuse to build the tools on broken
135 # systems/architectures. Hence we make sure that xfsprogs will never use a
136 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
138 crc32selftest
: gen_crc32table.c crc32table.h crc32.c crc32defs.h
139 @echo
" [TEST] CRC32"
140 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -D CRC32_SELFTEST
=1 crc32.c
-o
$@
143 # set up include/xfs header directory
144 include $(BUILDRULES
)
147 $(INSTALL
) -m
755 -d
$(PKG_INC_DIR
)
149 install-headers
: $(addsuffix -hdrs
, $(PKGHFILES
))
152 $(Q
)$(LN_S
) -f
$(CURDIR
)/$* $(TOPDIR
)/include/xfs
/$*
155 $(INSTALL
) -m
644 $(PKGHFILES
) $(PKG_INC_DIR
)
157 # We need to install the headers before building the dependencies. If we
158 # include the .ltdep file, the makefile decides that it needs to build the
159 # dependencies to remake the makefile before running the header install target,
160 # hence making it impossible to avoid errors being thrown by the dependency
161 # generation. Hence we play games so that we only include this file if we aren't
162 # running the install-headers target.