xfstests: Automatic build dependency calculations
[xfstests-dev.git] / src / Makefile
1 #
2 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
3 #
4
5 TOPDIR = ..
6 include $(TOPDIR)/include/builddefs
7
8 TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
9         nametest permname randholes runas truncfile usemem \
10         mmapcat append_reader append_writer dirperf metaperf \
11         devzero feature alloc fault fstest t_access_root \
12         godown resvtest writemod makeextents itrash rename \
13         multi_open_unlink dmiperf unwritten_sync genhashnames
14
15 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize \
16         ftrunc trunc fs_perms testx looptest locktest unwritten_mmap \
17         bulkstat_unlink_test bulkstat_unlink_test_modified t_dir_offset \
18         t_futimens
19
20 SUBDIRS =
21
22 LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL)
23
24 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
25 LINUX_TARGETS += loggen
26 endif
27
28 IRIX_TARGETS = open_unlink
29
30 ifeq ($(PKG_PLATFORM),linux)
31 PREALLO_TARGETS = preallo_rw_pattern_reader
32 TARGETS += $(LINUX_TARGETS)
33 TARGETS += t_immutable
34 endif
35
36 ifeq ($(PKG_PLATFORM),irix)
37 TARGETS += $(IRIX_TARGETS)
38 LLDLIBS += -lgen
39 endif
40
41 ifeq ($(HAVE_DB), true)
42 TARGETS += dbtest
43 LLDLIBS += $(LIBGDBM)
44 endif
45
46 ifeq ($(HAVE_AIO), true)
47 SUBDIRS += aio-dio-regress
48 endif
49
50 CFILES = $(TARGETS:=.c)
51 LDIRT = $(TARGETS)
52
53
54 default: depend $(TARGETS) $(SUBDIRS)
55
56 include $(BUILDRULES)
57
58 $(TARGETS): $(LIBTEST)
59         @echo "    [CC]    $@"
60         $(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LIBTEST)
61
62 LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS)
63
64 install: default $(addsuffix -install,$(SUBDIRS))
65         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)/src
66         $(INSTALL) -m 755 $(TARGETS) $(PKG_LIB_DIR)/src
67         $(INSTALL) -m 755 fill2attr fill2fs fill2fs_check scaleread.sh $(PKG_LIB_DIR)/src
68         $(INSTALL) -m 644 dumpfile $(PKG_LIB_DIR)/src
69
70 %-install:
71         $(MAKE) -C $* install
72
73 -include .dep