mtd/util Makefile,1.39,1.40

David Woodhouse dwmw2 at infradead.org
Wed May 5 12:50:53 EDT 2004


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv5347

Modified Files:
	Makefile 
Log Message:
handle dependencies

Index: Makefile
===================================================================
RCS file: /home/cvs/mtd/util/Makefile,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Makefile	5 May 2004 16:13:47 -0000	1.39
+++ Makefile	5 May 2004 16:50:50 -0000	1.40
@@ -8,19 +8,28 @@
 
 #CROSS=arm-linux-
 CC := $(CROSS)gcc
-CFLAGS += -I../include -O2 -Wall -Wstrict-prototypes -Wshadow
+CFLAGS := -I../include -O2 -Wall
 
 TARGETS = ftl_format erase eraseall  nanddump doc_loadbios \
 	mkfs.jffs ftl_check mkfs.jffs2 lock unlock \
 	einfo mtd_debug fcp nandwrite jffs2dump \
 	nftldump nftl_format #jffs2reader
 
+%: %.o
+	$(CC) $(LDFLAGS) -g -o $@ $^
+
+%.o: %.c
+	$(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$<.dep
+
+.SUFFIXES:
+
 all: $(TARGETS)
 
-clean:
-	rm -f *.o $(TARGETS)
+-include ${wildcard .*.c.dep}
+
 
-mkfs.jffs2.o eraseall.o crc32.o: crc32.h
+clean:
+	rm -f *.o $(TARGETS) .*.c.dep
 
 mkfs.jffs2: crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o
 	$(CC) $(LDFLAGS) -o $@ $^ -lz
@@ -38,4 +47,4 @@
 	mkdir -p ${DESTDIR}/${PREFIX}
 	for a in ${TARGETS}; do install -m0755 -oroot -groot -s -D $$a ${DESTDIR}/${SBINDIR}/$$a; done
 	mkdir -p ${MANDIR}/man/man1
-	gzip mkfs.jffs2.1 > ${MANDIR}/man/man1/mkfs.jffs2.1.gz
+	gzip -c mkfs.jffs2.1 > ${MANDIR}/man/man1/mkfs.jffs2.1.gz




More information about the linux-mtd-cvs mailing list