top_srcdir = @top_srcdir@
include ../../Makefile.common
-all: SWF.$(SLEXT) gfx.$(SLEXT)
+all: SWF.$(SLEXT) SWF$(A) gfx.$(SLEXT) gfx$(A)
exe: mypython$(E) swfpython$(E) testmem$(E)
primitives.$(O): primitives.c primitives.h
SWF.$(O): SWF.c pyutils.h primitives.h taglist.h
$(C) -Wall -Wno-unused -fPIC $(PYTHON_INCLUDES) -c SWF.c -o SWF.$(O)
-SWF.$(SLEXT): SWF.$(O) taglist.$(O) tag.$(O) image.$(O) tags.$(O) tagmap.$(O) action.$(O) primitives.$(O) pyutils.$(O) ../librfxswf$(A) ../png.$(O) Makefile
- $(L) -g $(SHARED) SWF.$(O) tagmap.$(O) taglist.$(O) tag.$(O) image.$(O) tags.$(O) action.$(O) primitives.$(O) pyutils.$(O) -o SWF.$(SLEXT) $(PYTHON_LIB) ../librfxswf$(A) ../png.$(O) $(LIBS)
+SWF_OBJS=SWF.$(O) taglist.$(O) tag.$(O) image.$(O) tags.$(O) tagmap.$(O) action.$(O) primitives.$(O) pyutils.$(O)
+SWF_DEPS=../librfxswf$(A) ../libbase$(A) ../art/libart$(A)
+SWF.$(SLEXT): $(SWF_OBJS) $(SWF_DEPS) Makefile
+ $(L) -g $(SHARED) $(SWF_OBJS) $(SWF_DEPS) -o SWF.$(SLEXT) $(PYTHON_LIB) $(LIBS)
+SWF$(A): $(SWF_OBJS) $(SWF_DEPS) Makefile
+ $(AR) cru SWF$(A) $(SWF_OBJS) $(SWF_DEPS)
+ $(RANLIB) SWF$(A)
-gfx.$(SLEXT): gfx.$(O) ../libpdf$(A) ../devices/swf.$(O) ../librfxswf$(A) ../libgfx$(A) ../libbase$(A) ../art/libart$(A) Makefile
- $(L) -g $(SHARED) gfx.$(O) -o gfx.$(SLEXT) ../libpdf$(A) ../devices/swf.$(O) ../librfxswf$(A) ../libgfx$(A) ../libbase$(A) ../art/libart$(A) $(PYTHON_LIB) $(LIBS)
+GFX_DEPS=../libpdf$(A) ../devices/swf.$(O) ../librfxswf$(A) ../devices/artsutils.$(O) ../devices/arts.$(O) ../art/libart$(A) ../libgfx$(A) ../libbase$(A)
+gfx.$(SLEXT): gfx.$(O) $(GFX_DEPS) Makefile
+ $(L) -g $(SHARED) gfx.$(O) -o gfx.$(SLEXT) $(GFX_DEPS) $(PYTHON_LIB) $(LIBS) $(CXXLIBS)
+gfx$(A): gfx.$(O) $(GFX_DEPS) Makefile
+ mkdir tmp;cd tmp;for file in $(GFX_DEPS);do ar x ../$$file || cp ../$$file .;done
+ $(AR) cru gfx$(A) gfx.$(O) tmp/*.$(O)
+ $(RANLIB) gfx$(A)
#TODO:
install: