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 \
92 xfs_refcount_btree.c \
97 xfs_symlink_remote.c \
100 CFILES
+= $(PKG_PLATFORM
).c
101 PCFILES
= darwin.c freebsd.c irix.c linux.c
102 LSRCFILES
= $(shell echo
$(PCFILES
) | sed
-e
"s/$(PKG_PLATFORM).c//g")
103 LSRCFILES
+= gen_crc32table.c
107 # -DIO_DEBUG reads and writes of buffers
108 # -DMEM_DEBUG all zone memory use
109 # -DLI_DEBUG log item (ino/buf) manipulation
110 # -DXACT_DEBUG transaction state changes
116 LTLIBS
= $(LIBPTHREAD
) $(LIBRT
)
118 # don't try linking xfs_repair with a debug libxfs.
121 LDIRT
= gen_crc32table crc32table.h crc32selftest
123 default
: crc32selftest ltdepend
$(LTLIBRARY
)
125 crc32table.h
: gen_crc32table.c crc32defs.h
126 @echo
" [CC] gen_crc32table"
127 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -o gen_crc32table
$<
128 @echo
" [GENERATE] $@"
129 $(Q
) .
/gen_crc32table
> crc32table.h
131 # The selftest binary will return an error if it fails. This is made a
132 # dependency of the build process so that we refuse to build the tools on broken
133 # systems/architectures. Hence we make sure that xfsprogs will never use a
134 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
136 crc32selftest
: gen_crc32table.c crc32table.h crc32.c crc32defs.h
137 @echo
" [TEST] CRC32"
138 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -D CRC32_SELFTEST
=1 crc32.c
-o
$@
141 # set up include/xfs header directory
142 include $(BUILDRULES
)
145 $(INSTALL
) -m
755 -d
$(PKG_INC_DIR
)
147 install-headers
: $(addsuffix -hdrs
, $(PKGHFILES
))
150 $(Q
)$(LN_S
) -f
$(CURDIR
)/$* $(TOPDIR
)/include/xfs
/$*
153 $(INSTALL
) -m
644 $(PKGHFILES
) $(PKG_INC_DIR
)
155 # We need to install the headers before building the dependencies. If we
156 # include the .ltdep file, the makefile decides that it needs to build the
157 # dependencies to remake the makefile before running the header install target,
158 # hence making it impossible to avoid errors being thrown by the dependency
159 # generation. Hence we play games so that we only include this file if we aren't
160 # running the install-headers target.