1 # Makefile for YAFFS direct stress tests
4 # YAFFS: Yet another Flash File System. A NAND-flash specific file system.
6 # Copyright (C) 2003-2010 Aleph One Ltd.
9 # Created by Charles Manning <charles@aleph1.co.uk>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2 as
13 # published by the Free Software Foundation.
15 # NB Warning this Makefile does not include header dependencies.
17 # $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
19 #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
21 CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2
22 CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
23 CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
24 #CFLAGS += -fno-strict-aliasing
26 CFLAGS += -Wextra -Wpointer-arith
27 #CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
29 #CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
30 #CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
33 COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
34 yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
35 yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
36 yaffs_checkptrw.o yaffs_qsort.o\
37 yaffs_nameval.o yaffs_attribs.o \
38 yaffs_norif1.o ynorsim.o \
45 # yaffs_checkptrwtest.o\
47 TESTFILES = quick_tests.o lib.o \
48 test_yaffs_mount.o test_yaffs_mount_ENODEV.o test_yaffs_mount_ENAMETOOLONG.o test_yaffs_mount_EBUSY.o \
49 test_yaffs_unmount.o test_yaffs_unmount_ENODEV.o test_yaffs_unmount_ENAMETOOLONG.o test_yaffs_unmount_EBUSY.o \
50 test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o \
51 test_yaffs_open_ENAMETOOLONG.o \
52 test_yaffs_open_EINVAL.o test_yaffs_open_EINVAL2.o \
53 test_yaffs_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o \
54 test_yaffs_unlink_ENOTDIR.o test_yaffs_unlink_ENOENT2.o \
55 test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_big_file.o \
56 test_yaffs_truncate.o test_yaffs_truncate_ENOTDIR.o test_yaffs_truncate_EISDIR.o test_yaffs_truncate_ENOENT.o \
57 test_yaffs_truncate_EINVAL.o test_yaffs_truncate_big_file.o test_yaffs_truncate_ENOENT2.o\
58 test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o \
59 test_yaffs_read.o test_yaffs_read_EBADF.o test_yaffs_read_EINVAL.o\
60 test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_big_file.o \
61 test_yaffs_access.o test_yaffs_access_EINVAL.o test_yaffs_access_ENOTDIR.o test_yaffs_access_ENOENT.o \
62 test_yaffs_access_ENOENT2.o \
63 test_yaffs_stat.o test_yaffs_stat_ENOENT.o test_yaffs_stat_ENOTDIR.o test_yaffs_stat_ENOENT2.o \
64 test_yaffs_fstat.o test_yaffs_fstat_EBADF.o \
65 test_yaffs_close_EBADF.o\
66 test_yaffs_chmod.o test_yaffs_chmod_ENOENT.o test_yaffs_chmod_ENOTDIR.o test_yaffs_chmod_EINVAL.o \
67 test_yaffs_chmod_ENOENT2.o \
68 test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o\
69 test_yaffs_fsync.o test_yaffs_fsync_EBADF.o \
70 test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \
71 test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o test_yaffs_mkdir_ENOENT.o\
72 test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o \
73 test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o test_yaffs_symlink_EEXIST.o test_yaffs_symlink_ENOENT.o \
74 test_yaffs_symlink_ENOENT2.o \
75 test_yaffs_mount2.o test_yaffs_mount2_ENODEV.o \
76 test_yaffs_unmount2.o test_yaffs_unmount2_ENODEV.o test_yaffs_unmount2_EINVAL.o \
77 test_yaffs_unmount2_with_handle_open_and_forced_mode_on.o test_yaffs_unmount2_with_handle_open_and_forced_mode_off.o\
78 test_yaffs_sync.o test_yaffs_sync_ENODEV.o \
79 test_yaffs_remount_force_off_read_only_off.o test_yaffs_remount_force_on_read_only_off.o test_yaffs_remount_ENODEV.o \
80 test_yaffs_remount_EINVAL.o \
81 test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o \
82 test_yaffs_totalspace.o test_yaffs_totalspace_EINVAL.o \
83 test_yaffs_inodecount.o test_yaffs_inodecount_EINVAL.o \
84 test_yaffs_link.o test_yaffs_link_ENOENT.o test_yaffs_link_EEXIST.o test_yaffs_link_ENOTDIR.o \
85 test_yaffs_link_ENOTDIR2.o test_yaffs_link_ENOENT2.o test_yaffs_link_ENOENT3.o test_yaffs_link_ENOENT3.o \
91 YAFFSTESTOBJS = $(COMMONTESTOBJS) $(TESTFILES)
93 PYTONOSYMLINKS = yaffs_error_converter.c yaffs_error_converter.h
94 PYTHONOBJS = yaffs_error_converter.o
96 ALLOBJS = $(sort $(YAFFSTESTOBJS)) $(PYTHONOBJS)
98 YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscompat.c yaffs_tagscompat.h \
99 yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
100 yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
101 yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
102 yaffs_nameval.c yaffs_nameval.h \
103 yaffs_trace.h yaffs_attribs.h \
104 yaffs_allocator.c yaffs_allocator.h \
105 yaffs_yaffs1.c yaffs_yaffs1.h \
106 yaffs_yaffs2.c yaffs_yaffs2.h \
107 yaffs_bitmap.c yaffs_bitmap.h \
108 yaffs_verify.c yaffs_verify.h
110 YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
111 yaffsfs.h yaffs_malloc.h ydirectenv.h \
112 yaffs_flashif.c yaffscfg.h yaffs_qsort.c \
113 yaffs_nandemul2k.h yaffs_list.h \
115 yaffs_nandif.c yaffs_nandif.h yportenv.h
118 DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
119 yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
120 yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
123 SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS) $(PYTONOSYMLINKS)
124 #all: directtest2k boottest
129 gcc -c $(CFLAGS) -o $@ $<
132 ln -s ../../python/$@ $@
137 $(YAFFSDIRECTSYMLINKS):
140 $(DIRECTEXTRASYMLINKS):
141 ln -s ../../basic-test/$@ $@
144 quick_tests: $(SYMLINKS) $(ALLOBJS)
145 gcc $(CFLLAG) -o $@ $(ALLOBJS)
153 rm -f quick_tests $(ALLOBJS) core $(SYMLINKS)