da8a9f18e8c4608008bafe8ee40d5459cc9d0339
[yaffs2.git] / Makefile
1 # Main Makefile for out-of-tree yaffs2.ko building
2 #
3 #
4 # YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
5 #
6 # Copyright (C) 2002-2010 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
16 ifneq ($(KERNELRELEASE),)
17         EXTRA_CFLAGS += -DYAFFS_OUT_OF_TREE
18
19         obj-m := yaffs2.o
20
21         yaffs2-objs := yaffs_mtdif.o yaffs_mtdif2.o
22         yaffs2-objs += yaffs_mtdif1.o yaffs_packedtags1.o
23         yaffs2-objs += yaffs_ecc.o yaffs_fs.o yaffs_guts.o
24         yaffs2-objs += yaffs_packedtags2.o
25         yaffs2-objs += yaffs_tagscompat.o yaffs_tagsvalidity.o
26         yaffs2-objs += yaffs_checkptrw.o yaffs_nand.o
27         yaffs2-objs += yaffs_checkptrw.o yaffs_nand.o yaffs_nameval.o
28         yaffs2-objs += yaffs_allocator.o yaffs_bitmap.o
29         yaffs2-objs += yaffs_yaffs1.o
30         yaffs2-objs += yaffs_yaffs2.o
31         yaffs2-objs += yaffs_verify.o
32
33 else
34         KERNELDIR ?= /lib/modules/$(shell uname -r)/build
35         PWD := $(shell pwd)
36
37 modules default:
38         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
39
40 mi modules_install:
41         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
42
43 clean:
44         $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
45 endif