diff direct/python/Makefile @ 319:3ef58b114b5e

Change from SWIG to ctypes... much easier
author charles
date Fri, 09 Oct 2009 07:12:26 +0100
parents 0b4bc5c0868e
children e239e0b8c57d
line wrap: on
line diff
--- a/direct/python/Makefile
+++ b/direct/python/Makefile
@@ -36,10 +36,10 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.
 		 yaffs_norif1.o  ynorsim.o
 
 
-YAFFSTESTOBJS  = $(COMMONTESTOBJS) yaffs_wrap.o yaffs_swig_helper.o
+YAFFSSWIGOBJS  = $(COMMONTESTOBJS) yaffs_wrap.o yaffs_python_helper.o
+YAFFSLIBOBJS  = $(COMMONTESTOBJS) yaffs_python_helper.o
 
 
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
 
 YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
           yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h  yaffs_nandemul2k.h \
@@ -56,7 +56,7 @@ YAFFSDIRECTSYMLINKS =  yaffscfg2k.c yaff
 
 SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS)
 
-all: _yaffs.so
+all: _yaffs.so libyaffsfs.so
 
 yaffs_wrap.c: yaffs.i yaffsfs_for_swig.h
 	swig -python yaffs.i
@@ -71,7 +71,10 @@ yaffsfs_for_swig.h: yaffsfs.h
 	sed -e "s/struct yaffs_stat/struct yaffs_stat_struct/g" \
 	> $@
 
-$(ALLOBJS): %.o: %.c
+$(YAFFSLIBOBJS): %.o: %.c
+	gcc -c $(CFLAGS)   -o $@ $<
+
+yaffs_wrap.o:  %.o: %.c
 	gcc -c $(CFLAGS) -I/usr/include/python2.6/  -o $@ $<
 
 
@@ -83,13 +86,18 @@ yaffsfs_for_swig.h: yaffsfs.h
 
 
 
-_yaffs.so: $(SYMLINKS) yaffs_wrap.c $(ALLOBJS)
-	gcc -shared $(ALLOBJS) -o $@
+_yaffs.so: $(SYMLINKS) yaffs_wrap.c $(YAFFSSWIGOBJS)
+	gcc -shared $(YAFFSSWIGOBJS) -o $@
+
+libyaffsfs.so: $(SYMLINKS) $(YAFFSLIBOBJS)
+	gcc -shared $(YAFFSLIBOBJS) -o $@
 
 
 
 
 clean:
-	rm -f _yaffs.so yaffs.py yaffs.pyc yaffs_wrap.c $(ALLOBJS) core $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS)
+	rm -f _yaffs.so yaffs.py yaffs.pyc yaffs_wrap.c $(YAFFSLIBOBJS) yaffs_wrap.o core $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS)
 	rm -f *.c.*
 	rm -f yaffsfs_for_swig.h
+	rm -f libyaffsfs.so
+