d56dcf63c2a744edc11e9a85a7dcb618b4ad8341
[yaffs2.git] / direct / test-framework / FrameworkRules.mk
1 # Makefile rules for building in test framwork
2 #
3 #
4 # YAFFS: Yet another Flash File System. A NAND-flash specific file system.
5 #
6 # Copyright (C) 2002-2018 Aleph One Ltd.
7 #
8 #
9 # Created by Charles Manning <charles@aleph1.co.uk>
10 #
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.
14 #
15 # NB Warning this Makefile does not include header dependencies.
16 #
17
18 #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
19
20 CFLAGS =      -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2  -DCONFIG_YAFFS_DEFINES_TYPES
21 CFLAGS +=     -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
22 CFLAGS +=    -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing -Werror
23 #CFLAGS +=    -fno-strict-aliasing
24 CFLAGS +=    -O0
25 CFLAGS +=    -Wextra -Wpointer-arith
26 #CFLAGS +=    -DCONFIG_YAFFS_VALGRIND_TEST
27
28 #CFLAGS+=   -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
29 #CFLAGS+=   -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
30
31
32 COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o yaffs_error.o\
33                  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_tagsmarshall.o \
36                  yaffs_packedtags2.o yaffs_nand.o \
37                  yaffs_checkptrw.o  \
38                  yaffs_endian.o \
39                  yaffs_nameval.o yaffs_attribs.o \
40                  yaffs_m18_drv.o  yaffs_nor_drv.o ynorsim.o \
41                  yaffs_nand_drv.o \
42                  nanddrv.o \
43                  yaffs_nandsim_file.o nandsim.o nandsim_file.o nandstore_file.o \
44                  yaffs_allocator.o \
45                  yaffs_bitmap.o \
46                  yaffs_yaffs1.o \
47                  yaffs_yaffs2.o \
48                  yaffs_verify.o \
49                  yaffs_summary.o
50
51
52
53 ALLOBJS = $(sort $(ALL_UNSORTED_OBJS))
54
55 YAFFSDIRECTSYMLINKS =  \
56           yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
57           yaffsfs.h yaffs_osglue.h ydirectenv.h \
58           yaffscfg.h \
59           yaffs_nandemul2k.h yaffs_list.h \
60           yaffs_attribs.c \
61           yportenv.h \
62           yaffs_hweight.c yaffs_hweight.h \
63           yaffs_endian.c yaffs_endian.h \
64           yaffs_error.c \
65           yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h \
66           yaffs_tagscompat.c yaffs_tagscompat.h \
67           yaffs_tagsmarshall.c yaffs_tagsmarshall.h \
68           yaffs_packedtags1.c yaffs_packedtags1.h \
69           yaffs_packedtags2.c yaffs_packedtags2.h  \
70           yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
71           yaffs_checkptrw.h yaffs_checkptrw.c \
72           yaffs_nameval.c yaffs_nameval.h \
73           yaffs_trace.h yaffs_attribs.h \
74           yaffs_allocator.c yaffs_allocator.h \
75           yaffs_yaffs1.c yaffs_yaffs1.h \
76           yaffs_yaffs2.c yaffs_yaffs2.h \
77           yaffs_bitmap.c yaffs_bitmap.h \
78           yaffs_verify.c yaffs_verify.h \
79           yaffs_summary.c yaffs_summary.h
80
81
82 FRAMEWORKEXTRASYMLINKS = \
83                 yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
84                 yaffs_fileem.c yaffs_m18_drv.c yaffs_m18_drv.h \
85                 yaffs_nor_drv.c yaffs_nor_drv.h \
86                 yaffs_nand_drv.c yaffs_nand_drv.h \
87                 yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
88                 nand_chip.h nanddrv.c nanddrv.h nandsim.c nandsim.h nand_store.h \
89                 nandsim_file.c nandsim_file.h nandstore_file.c nandstore_file.h \
90                 yaffs_nandsim_file.c yaffs_nandsim_file.h \
91                 ynorsim.h ynorsim.c yaffs_osglue.c
92
93 FRAMEWORK_SOURCES = $(YAFFSDIRECTSYMLINKS) $(FRAMEWORKEXTRASYMLINKS)
94
95 clean:
96         rm -f $(TARGETS) $(ALLOBJS) core $(FRAMEWORK_SOURCES) $(CLEAN_OBJS)
97
98 $(YAFFSDIRECTSYMLINKS):
99         ln -s $(YDI_DIR)/$@ $@
100
101
102 $(FRAMEWORKEXTRASYMLINKS):
103         ln -s $(YDI_FRAMEWORK_DIR)/$@ $@
104
105 $(ALLOBJS): %.o: %.c
106         gcc -c $(CFLAGS)   -o $@ $<