3 # NB this is not yet suitable for putting into the kernel tree.
4 # YAFFS: Yet another Flash File System. A NAND-flash specific file system.
6 # Copyright (C) 2002 Aleph One Ltd.
7 # for Toby Churchill Ltd and Brightstar Engineering
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 ## Change or override KERNELDIR to your kernel
17 #KERNELDIR = /usr/src/kernel-headers-2.4.18
19 CFLAGS = -O2 -Wall -DCONFIG_YAFFS_UTIL
20 CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
21 CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
23 ## Change if you are using a cross-compiler
28 COMMON_BASE_C_LINKS = yaffs_ecc.c
29 COMMON_BASE_LINKS = $(COMMON_BASE_C_LINKS) yaffs_ecc.h yaffs_guts.h yaffs_packedtags2.h yaffs_trace.h
30 COMMON_DIRECT_C_LINKS = yaffs_hweight.c
31 COMMON_C_LINKS = $(COMMON_DIRECT_C_LINKS) $(COMMON_BASE_C_LINKS)
32 COMMON_DIRECT_LINKS= $(COMMON_DIRECT_C_LINKS) yportenv.h yaffs_hweight.h yaffs_list.h
33 COMMONOBJS = $(COMMON_C_LINKS:.c=.o)
35 MKYAFFSSOURCES = mkyaffsimage.c
36 MKYAFFSIMAGEOBJS = $(MKYAFFSSOURCES:.c=.o)
38 MKYAFFS2SOURCES = mkyaffs2image.c
39 MKYAFFS2LINKS = yaffs_packedtags2.c
40 MKYAFFS2IMAGEOBJS = $(MKYAFFS2SOURCES:.c=.o) $(MKYAFFS2LINKS:.c=.o)
42 BASE_LINKS = $(MKYAFFSLINKS) $(MKYAFFS2LINKS) $(COMMON_BASE_LINKS)
43 DIRECT_LINKS = $(MKYAFFS_DIRECT_LINKS) $(MKYAFFS2_DIRECT_LINKS) $(COMMON_DIRECT_LINKS)
44 ALL_LINKS = $(BASE_LINKS) $(DIRECT_LINKS)
46 all: mkyaffsimage mkyaffs2image
54 $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : $(ALL_LINKS)
56 $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c
57 $(CC) -c $(CFLAGS) $< -o $@
59 mkyaffsimage: $(MKYAFFSIMAGEOBJS) $(COMMONOBJS)
62 mkyaffs2image: $(MKYAFFS2IMAGEOBJS) $(COMMONOBJS)
67 rm -f $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) $(ALL_LINKS) mkyaffsimage mkyaffs2image core