*** empty log message ***
[yaffs/.git] / linux-module / Makefile
1
2 #
3 # NB this is not yet suitable for putting into the kernel tree.
4 # YAFFS: Yet another FFS. A NAND-flash specific file system. 
5 #
6 # Copyright (C) 2002 Aleph One Ltd.
7 #   for Toby Churchill Ltd and Brightstar Engineering
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 # $Id: Makefile,v 1.2 2006-05-17 21:04:58 charles Exp $
16 #
17
18 #Makefile for manually hacking YAFFS as a module.
19
20
21 SYMLINKS = yaffs_fs.c yaffs_guts.c yaffs_guts.h yaffs_ecc.c yaffs_ecc.h yaffs_mtdif.c yaffs_mtdif.h yaffs_ramem.c yaffs_nandemul.h yportenv.h yaffsinterface.h devextras.h
22
23
24 ## Change or override  KERNELDIR to your kernel
25 ## comment out USE_xxxx if you don't want these features.
26
27 KERNELDIR = /opt/2.6.12/linux-2.6.12.2
28
29 ## Change if you are using a cross-compiler
30 MAKETOOLS = 
31
32 CC=$(MAKETOOLS)gcc
33 LD=$(MAKETOOLS)ld
34
35 # Configurations...
36 # Comment out the stuff you don't want.
37 #
38
39 # CONFIG_YAFFS_RAM_ENABLED.
40 # This adds the yaffsram file system support. Nice for testing on x86, but uses 2MB of RAM.
41 # Don't enable for NAND-based targets.
42
43 USE_RAM_FOR_TEST = -DCONFIG_YAFFS_RAM_ENABLED
44
45
46 # CONFIG_YAFFS_MTD_ENABLED.
47 # This adds the yaffs file system support for working with a NAND mtd.
48
49 USE_MTD = -DCONFIG_YAFFS_MTD_ENABLED
50
51 # CONFIG_YAFFS_USE_OLD_MTD
52 # Enable this to use the old MTD stuff that did not have yaffs support.
53 # You can use this to get around compilation problems, but the best
54 # thing to do is to upgrade your MTD support. You will get better speed.
55
56 #USE_OLD_MTD = -DCONFIG_YAFFS_USE_OLD_MTD
57
58 # CONFIG_YAFFS_USE_NANDECC
59 # This enables the ECC functions of the generic MTD-NAND driver.
60 # This will not work if you are using the old mtd.
61 #
62 # NB UseNANDECC does not work at present with yaffsram.
63
64 USE_NANDECC = -DCONFIG_YAFFS_USE_NANDECC
65
66 # CONFIG_YAFFS_ECC_WRONG_ORDER
67 # This makes yaffs_ecc.c use the same ecc byte order as
68 # Steven Hill's nand_ecc.c. If not set, then you get the
69 # same ecc byte order as SmartMedia.
70
71 #USE_WRONGECC = -DCONFIG_YAFFS_ECC_WRONG_ORDER
72
73 # CONFIG_YAFFS_USE_GENERIC_RW
74 # Use generic_read/generic_write for reading/writing files. This enables the use of the Linux
75 # file caching layer.
76 #
77 # If you disable this, then caching is disabled and file read/write is direct.
78
79 USE_GENERIC_RW = -DCONFIG_YAFFS_USE_GENERIC_RW
80
81 # CONFIG_YAFFS_USE_HEADER_FILE_SIZE
82 # When the flash is scanned, two file sizes are constructed:
83 # * The size taken from the object header for the file.
84 # * The size figured out by scanning the data chunks.
85 # If this option is enabled, then the object header size is used, otherwise the scanned size is used.
86 # Suggest leaving this disabled.
87
88 #USE_HEADER_FILE_SIZE = -DCONFIG_YAFFS_USE_HEADER_FILE_SIZE
89
90 #CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK
91 # Enabling this turns off the test that chunks are erased in flash before writing to them.
92 # this is safe, since the write verification will fail.
93 # Suggest enabling the test (ie. keep the following line commented) during development to help debug things.
94
95 #IGNORE_CHUNK_ERASED = -DCONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK
96
97 #CONFIG_YAFFS_DISABLE_WRITE_VERIFY
98 # I am severely reluctant to provide this config. Disabling the verification is not a good thing to do
99 # since NAND writes can fail silently.
100 # Disabling the write verification will cause your teeth to rot, rats to eat your corn and give you split ends.
101 # You have been warned. ie. Don't uncomment the following line.
102
103 #IGNORE_WRITE_VERIFY = -DCONFIG_YAFFS_DISBLE_WRITE_VERIFY
104
105 #CONFIG_YAFFS_SHORT_NAMES_IN_RAM
106 # If this config is set, then short names are stored with the yaffs_Object
107 # This costs an extra 16 bytes of RAM per object, but makes look-ups faster.
108
109 ENABLE_SHORT_NAMES_IN_RAM = -DCONFIG_SHORT_NAMES_IN_RAM
110
111 # End of configuration options.
112
113 YAFFS_CONFIGS = $(USE_RAM_FOR_TEST) $(USE_MTD) $(USE_GENERIC_RW) $(USE_HEADER_FILE_SIZE) $(IGNORE_CHUNK_ERASED) $(IGNORE_WRITE_VERIFY) \
114                 $(ENABLE_SHORT_NAMES_IN_RAM) $(USE_NANDECC) $(USE_OLD_MTD) $(USE_WRONGECC)
115
116
117 CFLAGS = -D__KERNEL__ -DMODULE  $(YAFFS_CONFIGS)  -I $(KERNELDIR)/include -O2 -Wall
118
119
120 OBJS = yaffs_fs.o yaffs_guts.o yaffs_ramem.o yaffs_mtdif.o yaffs_ecc.o
121
122
123 all: $(SYMLINKS) yaffs.o
124
125 $(SYMLINKS):
126         ln -s ../$@ $@
127
128 $(OBJS): %.o: %.c Makefile
129         $(CC) -c $(CFLAGS) $< -o $@
130
131 yaffs.o: $(OBJS)
132         $(LD) -r $(OBJS) -o $@
133
134 clean:
135         rm -f $(OBJS) core