1#Makefile for mkyaffs 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## Change or override KERNELDIR to your kernel 16 17#KERNELDIR = /usr/src/kernel-headers-2.4.18 18 19CFLAGS = -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL 20CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations 21CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline 22 23## Change if you are using a cross-compiler 24MAKETOOLS = 25 26CC=$(MAKETOOLS)gcc 27 28COMMONLINKS = yaffs_ecc.c 29COMMONOBJS = $(COMMONLINKS:.c=.o) 30 31MKYAFFSSOURCES = mkyaffsimage.c 32MKYAFFSIMAGEOBJS = $(MKYAFFSSOURCES:.c=.o) 33 34MKYAFFS2SOURCES = mkyaffs2image.c 35MKYAFFS2LINKS = yaffs_packedtags2.c yaffs_tagsvalidity.c 36MKYAFFS2IMAGEOBJS = $(MKYAFFS2SOURCES:.c=.o) $(MKYAFFS2LINKS:.c=.o) 37 38all: mkyaffsimage mkyaffs2image 39 40$(COMMONLINKS) $(MKYAFFSLINKS) $(MKYAFFS2LINKS): 41 ln -s ../$@ $@ 42 43$(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c 44 $(CC) -c $(CFLAGS) $< -o $@ 45 46mkyaffsimage: $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) 47 $(CC) -o $@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) 48 49mkyaffs2image: $(COMMONOBJS) $(MKYAFFS2IMAGEOBJS) 50 $(CC) -o $@ $(COMMONOBJS) $(MKYAFFS2IMAGEOBJS) 51 52 53clean: 54 rm -f $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) $(COMMONLINKS) $(MKYAFFSLINKS) $(MKYAFFS2LINKS) mkyaffsimage mkyaffs2image core 55