bugfix
[libfirm] / Makefile.in
index f819979..c755730 100644 (file)
@@ -16,14 +16,14 @@ topdir := .
 # subdirectory under topdir
 subdir := .
 
-subdirs := ir ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr ir/ana ir/st
+subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr ir/ana ir/st
 
 SOURCES := Makefile.in MakeRules.in MakeTargets\
           aclocal.m4 config.h.in\
           config.guess config.sub configure.in \
           stamp-h.in install-sh README configure
 
-INSTALL_LIBS = libfirm.a
+INSTALL_LIBS = libfirm.a libfirm.so
 
 GENFILES := stamp-h config.log config.cache
 # config.status config.h.in $(srcdir)/stamp-h.in
@@ -34,18 +34,24 @@ XOFILES += $(addsuffix /subdir.o, $(subdirs))
 
 include $(top_srcdir)/MakeTargets
 
+# add target firmjni if configured with --enable-firmjni
+all: firm
 
-all: config.h Makefile libfirm.a
+firm: config.h Makefile libfirm.a libfirm.so
 
 libfirm.a: subdir_all $(XOFILES) $(OFILES)
        $(AR) $(ARFLAGS) $@.new $(XOFILES) $(OFILES)
        $(RANLIB) $@.new
        mv -f $@.new $@
 
+libfirm.so: subdir_all $(XOFILES) $(OFILES)
+       ld -Bshareable -o ./libfirm.so $(XOFILES) -lm
+
 testprograms:  libfirm.a
        $(MAKE) -C testprograms
-       $(MAKE) -C firmjni  test
 
+firmjni:: libfirm.a
+       $(MAKE) -C firmjni
 
 # gernerate program documentation
 .PHONY: autodoc
@@ -75,8 +81,11 @@ stamp-h: config.h.in config.status
 config.status: configure
        ./config.status --recheck
 
+# add target test-firmjni if configured with --enable-firmjni
 test::
        $(MAKE) -C testprograms test;
+
+test-firmjni::
        $(MAKE) -C firmjni test;
 
 test-reference::
@@ -84,3 +93,4 @@ test-reference::
 
 test-clean:
        $(MAKE) -C testprograms realclean
+       $(MAKE) -C firmjni/testprograms clean;