ncurses 5.7 - patch 20101127
[ncurses.git] / Ada95 / src / Makefile.in
index 5ad4b5b82da3f9987008e6b832befad0eb2a161f..4a599acb8927850d684d91e7f6a8d053e8ad4f21 100644 (file)
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  $Id: Makefile.in,v 1.42 2010/06/12 19:44:58 tom Exp $
+#  $Id: Makefile.in,v 1.53 2010/11/27 22:14:16 tom Exp $
 #
 .SUFFIXES:
 
 SHELL          = /bin/sh
+VPATH          = @srcdir@
 THIS           = Makefile
 
 MODEL          = ../../@DFT_OBJ_SUBDIR@
@@ -45,6 +46,7 @@ prefix                = @prefix@
 exec_prefix    = @exec_prefix@
 libdir         = ${exec_prefix}/lib
 
+LIBDIR         = $(DESTDIR)$(libdir)
 ADA_INCLUDE    = $(DESTDIR)@ADA_INCLUDE@
 ADA_OBJECTS    = $(DESTDIR)@ADA_OBJECTS@
 
@@ -82,31 +84,32 @@ ADAPREP             = gnatprep
 ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
 
 LIB_NAME       = AdaCurses
-SONAME         = lib$(LIB_NAME).so.1
+SONAME         = @ADA_SHAREDLIB@
 
-GNAT_PROJECT   = library.gpr
+GNAT_PROJECT   = $(srcdir)/library.gpr
 
 # build/source are the Ada95 tree
-BUILD_DIR      = @srcdir@/..
-SOURCE_DIR     = @srcdir@/..
+BUILD_DIR      = ..
+SOURCE_DIR     = ..
 
 BUILD_DIR_LIB  = $(BUILD_DIR)/lib
 SOURCE_DIR_SRC = $(SOURCE_DIR)/src
 
 ADAMAKE         = @cf_ada_make@
 ADAMAKEFLAGS    = \
-       -p \
        -P$(GNAT_PROJECT) \
-       -XBUILD_DIR=$(BUILD_DIR) \
-       -XSOURCE_DIR=$(SOURCE_DIR) \
+       -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
+       -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
+       -XSOURCE_DIR2=`cd $(srcdir);pwd` \
        -XLIB_NAME=$(LIB_NAME) \
        -XSONAME=$(SONAME)
 
 CARGS           = -cargs $(ADAFLAGS)
 LARGS           =
 
-MY_STATIC_LIB  = $(BUILD_DIR_LIB)/lib$(LIB_NAME).a
-MY_SHARED_LIB  = $(BUILD_DIR_LIB)/$(SONAME)
+STATIC_LIBNAME = lib$(LIB_NAME).a
+SHARED_LIBNAME = $(SONAME)
+SHARED_SYMLINK = lib$(LIB_NAME).so
 
 ALIB            = @cf_ada_package@
 ABASE           = $(ALIB)-curses
@@ -126,46 +129,6 @@ GENERATED_SOURCES=$(ABASE).ads                             \
                  $(ABASE)-forms-field_user_data.ads    \
                  $(ABASE)-panels-user_data.ads
 ################################################################################
-LIBALIS=$(ALIB).ali                                    \
-       $(ABASE)-aux.ali                                \
-       $(ABASE).ali                                    \
-       $(ABASE)-terminfo.ali                           \
-       $(ABASE)-termcap.ali                            \
-       $(ABASE)-putwin.ali                             \
-       $(ABASE)-trace.ali                              \
-       $(ABASE)-mouse.ali                              \
-       $(ABASE)-panels.ali                             \
-       $(ABASE)-menus.ali                              \
-       $(ABASE)-forms.ali                              \
-       $(ABASE)-forms-field_types.ali                  \
-       $(ABASE)-forms-field_types-alpha.ali            \
-       $(ABASE)-forms-field_types-alphanumeric.ali     \
-       $(ABASE)-forms-field_types-intfield.ali         \
-       $(ABASE)-forms-field_types-numeric.ali          \
-       $(ABASE)-forms-field_types-regexp.ali           \
-       $(ABASE)-forms-field_types-enumeration.ali      \
-       $(ABASE)-forms-field_types-ipv4_address.ali     \
-       $(ABASE)-forms-field_types-user.ali             \
-       $(ABASE)-forms-field_types-user-choice.ali      \
-       $(ABASE)-text_io.ali                            \
-       $(ABASE)-text_io-aux.ali
-
-# Ada Library files for generic packages. Since gnat 3.10 they are
-# also compiled
-GENALIS=$(ABASE)-menus-menu_user_data.ali              \
-       $(ABASE)-menus-item_user_data.ali               \
-       $(ABASE)-forms-form_user_data.ali               \
-       $(ABASE)-forms-field_user_data.ali              \
-       $(ABASE)-forms-field_types-enumeration-ada.ali  \
-       $(ABASE)-panels-user_data.ali                   \
-       $(ABASE)-text_io-integer_io.ali                 \
-       $(ABASE)-text_io-float_io.ali                   \
-       $(ABASE)-text_io-fixed_io.ali                   \
-       $(ABASE)-text_io-decimal_io.ali                 \
-       $(ABASE)-text_io-enumeration_io.ali             \
-       $(ABASE)-text_io-modular_io.ali                 \
-       $(ABASE)-text_io-complex_io.ali
-
 LIBOBJS=$(ALIB).o                                      \
        $(ABASE)-aux.o                                  \
        $(ABASE).o                                      \
@@ -206,40 +169,41 @@ GENOBJS=$(ABASE)-menus-menu_user_data.o                   \
        $(ABASE)-text_io-modular_io.o                   \
        $(ABASE)-text_io-complex_io.o
 
-all ::  $(MY_STATIC_LIB)
+all ::  $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
        @echo done
 
+$(ADA_INCLUDE) \
+$(ADA_OBJECTS) \
+$(LIBDIR) \
 $(BUILD_DIR_LIB) :
        mkdir -p $@
 
-$(MY_STATIC_LIB) :: $(BUILD_DIR_LIB) $(LIBOBJS) @cf_generic_objects@
-       $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
-
 sources :
        @echo made $@
 
 libs \
 install \
-install.libs :: $(MY_STATIC_LIB)
-       @echo made $(MY_STATIC_LIB)
+install.libs :: \
+               $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
+       @echo made $(STATIC_LIBNAME)
 
 install \
-install.libs :: $(MY_STATIC_LIB)
-       @$(INSTALL_LIB) $(MY_STATIC_LIB) $(ADA_OBJECTS)
-       @echo made $@
+install.libs :: \
+               $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
+               $(ADA_OBJECTS)
+       @$(INSTALL_LIB) \
+               $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
+               $(ADA_OBJECTS)
 
 uninstall \
 uninstall.libs ::
-       @echo made $@
-
-generics: $(GENALIS)
-       @echo made $@
+       @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
 
 mostlyclean ::
        rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
 
 clean :: mostlyclean
-       rm -f $(LIBALIS) $(GENALIS) $(LIBOBJS) $(GENOBJS) $(ABASE)-trace.adb
+       rm -f $(ABASE)-trace.adb
 
 distclean :: clean
        rm -f Makefile
@@ -248,229 +212,93 @@ realclean :: distclean
 
 BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
 
-$(ALIB).o: $(srcdir)/$(ALIB).ads
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads
-
-
-$(ABASE)-aux.o: $(srcdir)/$(ABASE)-aux.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-aux.adb
-
-
-$(ABASE).o: $(ABASE).adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(ABASE).adb
-
-
-$(ABASE)-terminfo.o: \
-               $(srcdir)/$(ABASE)-terminfo.ads \
-               $(srcdir)/$(ABASE)-terminfo.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-terminfo.adb
+$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
+       rm -f $@
+       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
 
+###############################################################################
+
+@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
+@USE_OLD_MAKERULES@            $(BUILD_DIR_LIB) \
+@USE_OLD_MAKERULES@            $(LIBOBJS) @cf_generic_objects@
+@USE_OLD_MAKERULES@    $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
+
+$(BUILD_DIR)/static-ali : ; mkdir -p $@
+$(BUILD_DIR)/static-obj : ; mkdir -p $@
+
+STATIC_DIRS = \
+       $(BUILD_DIR_LIB) \
+       $(BUILD_DIR)/static-ali \
+       $(BUILD_DIR)/static-obj
+
+@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
+@USE_GNAT_PROJECTS@            $(ABASE)-trace.adb \
+@USE_GNAT_PROJECTS@            $(STATIC_DIRS)
+@USE_GNAT_PROJECTS@    $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
+@USE_GNAT_PROJECTS@
+@USE_GNAT_PROJECTS@install \
+@USE_GNAT_PROJECTS@install.libs :: \
+@USE_GNAT_PROJECTS@            $(ADA_OBJECTS)
+@USE_GNAT_PROJECTS@    $(INSTALL_LIB) \
+@USE_GNAT_PROJECTS@            $(BUILD_DIR)/static-ali/*.ali \
+@USE_GNAT_PROJECTS@            $(ADA_OBJECTS)
 
-$(ABASE)-termcap.o: \
-               $(srcdir)/$(ABASE)-termcap.ads \
-               $(srcdir)/$(ABASE)-termcap.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-termcap.adb
+uninstall \
+uninstall.libs ::
+       @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
 
+@USE_GNAT_PROJECTS@uninstall \
+@USE_GNAT_PROJECTS@uninstall.libs ::
+@USE_GNAT_PROJECTS@    @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
 
-$(ABASE)-putwin.o: \
-               $(srcdir)/$(ABASE)-putwin.ads \
-               $(srcdir)/$(ABASE)-putwin.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-putwin.adb
+$(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
+$(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
 
+SHARED_DIRS = \
+       $(BUILD_DIR_LIB) \
+       $(BUILD_DIR)/dynamic-ali \
+       $(BUILD_DIR)/dynamic-obj
 
-$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
-       rm -f $@
-       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
+@MAKE_ADA_SHAREDLIB@all \
+@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS)
+@MAKE_ADA_SHAREDLIB@   $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
 
-$(ABASE)-trace.o: \
-               $(ABASE)-trace.ads \
-               $(ABASE)-trace.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(ABASE)-trace.adb
-
-
-$(ABASE)-mouse.o: \
-               $(ABASE)-mouse.ads \
-               $(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-mouse.adb
-
-
-$(ABASE)-panels.o: \
-               $(ABASE)-panels.ads \
-               $(srcdir)/$(ABASE)-panels.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels.adb
-
-
-$(ABASE)-menus.o: \
-               $(ABASE)-menus.ads \
-               $(srcdir)/$(ABASE)-menus.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus.adb
-
-
-$(ABASE)-forms.o: \
-               $(ABASE)-forms.ads \
-               $(srcdir)/$(ABASE)-forms.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms.adb
-
-$(ABASE)-forms-field_types.o: \
-               $(ABASE)-forms-field_types.ads \
-               $(srcdir)/$(ABASE)-forms-field_types.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types.adb
-
-$(ABASE)-forms-field_types-alpha.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-alpha.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-alpha.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alpha.adb
-
-$(ABASE)-forms-field_types-alphanumeric.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb
-
-$(ABASE)-forms-field_types-intfield.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-intfield.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-intfield.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-intfield.adb
-
-$(ABASE)-forms-field_types-numeric.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-numeric.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-numeric.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-numeric.adb
-
-$(ABASE)-forms-field_types-regexp.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-regexp.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-regexp.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-regexp.adb
-
-$(ABASE)-forms-field_types-enumeration.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-enumeration.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-enumeration.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration.adb
-
-$(ABASE)-forms-field_types-ipv4_address.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb
-
-$(ABASE)-forms-field_types-user.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-user.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-user.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user.adb
-
-$(ABASE)-forms-field_types-user-choice.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-user-choice.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-user-choice.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user-choice.adb
-
-$(ABASE)-text_io.o: \
-               $(srcdir)/$(ABASE)-text_io.ads \
-               $(srcdir)/$(ABASE)-text_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io.adb
-
-$(ABASE)-text_io-aux.o: \
-               $(srcdir)/$(ABASE)-text_io-aux.ads \
-               $(srcdir)/$(ABASE)-text_io-aux.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-aux.adb
-
-$(ABASE)-menus-menu_user_data.o: \
-               $(ABASE)-menus-menu_user_data.ads \
-               $(srcdir)/$(ABASE)-menus-menu_user_data.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-menu_user_data.adb
-
-$(ABASE)-menus-item_user_data.o: \
-               $(ABASE)-menus-item_user_data.ads \
-               $(srcdir)/$(ABASE)-menus-item_user_data.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-item_user_data.adb
-
-$(ABASE)-forms-form_user_data.o: \
-               $(ABASE)-forms-form_user_data.ads \
-               $(srcdir)/$(ABASE)-forms-form_user_data.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-form_user_data.adb
-
-$(ABASE)-forms-field_user_data.o: \
-               $(ABASE)-forms-field_user_data.ads \
-               $(srcdir)/$(ABASE)-forms-field_user_data.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_user_data.adb
-
-$(ABASE)-forms-field_types-enumeration-ada.o: \
-               $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.ads \
-               $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb
-
-$(ABASE)-panels-user_data.o: \
-               $(ABASE)-panels-user_data.ads \
-               $(srcdir)/$(ABASE)-panels-user_data.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels-user_data.adb
-
-$(ABASE)-text_io-integer_io.o: \
-               $(srcdir)/$(ABASE)-text_io-integer_io.ads \
-               $(srcdir)/$(ABASE)-text_io-integer_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-integer_io.adb
-
-$(ABASE)-text_io-float_io.o: \
-               $(srcdir)/$(ABASE)-text_io-float_io.ads \
-               $(srcdir)/$(ABASE)-text_io-float_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-float_io.adb
-
-$(ABASE)-text_io-fixed_io.o: \
-               $(srcdir)/$(ABASE)-text_io-fixed_io.ads \
-               $(srcdir)/$(ABASE)-text_io-fixed_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-fixed_io.adb
-
-$(ABASE)-text_io-decimal_io.o: \
-               $(srcdir)/$(ABASE)-text_io-decimal_io.ads \
-               $(srcdir)/$(ABASE)-text_io-decimal_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-decimal_io.adb
-
-$(ABASE)-text_io-enumeration_io.o: \
-               $(srcdir)/$(ABASE)-text_io-enumeration_io.ads \
-               $(srcdir)/$(ABASE)-text_io-enumeration_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-enumeration_io.adb
-
-$(ABASE)-text_io-modular_io.o: \
-               $(srcdir)/$(ABASE)-text_io-modular_io.ads \
-               $(srcdir)/$(ABASE)-text_io-modular_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-modular_io.adb
-
-$(ABASE)-text_io-complex_io.o: \
-               $(srcdir)/$(ABASE)-text_io-complex_io.ads \
-               $(srcdir)/$(ABASE)-text_io-complex_io.adb $(BASEDEPS)
-       $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-complex_io.adb
-
-# in-progress rewrite to use gnatmake library project files
-
-test_make: $(ABASE)-trace.adb
-       $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
-#      $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
-
-test_install:
-       install --directory $(ADA_INCLUDE)
+install \
+install.libs :: $(ADA_INCLUDE)
        $(INSTALL_LIB) \
                $(SOURCE_DIR_SRC)/*.ad[sb] \
-               $(GENERATED_SOURCES) \
                $(ADA_INCLUDE)
-       install --directory $(ADA_OBJECTS)
-#      $(INSTALL_LIB) \
-#              $(BUILD_DIR)/dynamic-ali/* \
-#              $(ADA_OBJECTS)
+
+install \
+install.libs :: $(ADA_INCLUDE)
        $(INSTALL_LIB) \
-               $(MY_STATIC_LIB) \
-               $(DESTDIR)/usr/lib
-#      $(INSTALL_LIB) \
-#              $(BUILD_DIR_LIB)/$(SONAME) \
-#              $(DESTDIR)/usr/lib
-#      cd $(DESTDIR)/usr/lib && ln -s $(SONAME) lib$(LIB_NAME).so
-
-test_uninstall:
-       rm -rf \
-               $(ADA_INCLUDE) \
-               $(ADA_OBJECTS) \
-       rm -f \
-               $(DESTDIR)/usr/lib/lib$(LIB_NAME).a
-#      rm -f \
-#              $(DESTDIR)/usr/lib/$(SONAME) \
-#              $(DESTDIR)/usr/lib/lib$(LIB_NAME).so
-
-test_clean:
+               $(GENERATED_SOURCES) \
+               $(ADA_INCLUDE)
+
+uninstall \
+uninstall.libs ::
+       $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done'
+
+@MAKE_ADA_SHAREDLIB@install \
+@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS)
+@MAKE_ADA_SHAREDLIB@   $(INSTALL_LIB) \
+@MAKE_ADA_SHAREDLIB@           $(BUILD_DIR)/dynamic-ali/* \
+@MAKE_ADA_SHAREDLIB@           $(ADA_OBJECTS)
+@MAKE_ADA_SHAREDLIB@   $(INSTALL_LIB) \
+@MAKE_ADA_SHAREDLIB@           $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \
+@MAKE_ADA_SHAREDLIB@           $(LIBDIR)
+@MAKE_ADA_SHAREDLIB@   cd $(LIBDIR) && ln -s $(SHARED_LIBNAME) $(SHARED_SYMLINK)
+@MAKE_ADA_SHAREDLIB@
+@MAKE_ADA_SHAREDLIB@uninstall \
+@MAKE_ADA_SHAREDLIB@uninstall.libs ::
+@MAKE_ADA_SHAREDLIB@   $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
+@MAKE_ADA_SHAREDLIB@
+@MAKE_ADA_SHAREDLIB@uninstall \
+@MAKE_ADA_SHAREDLIB@uninstall.libs ::
+@MAKE_ADA_SHAREDLIB@   rm -f $(LIBDIR)/$(SHARED_SYMLINK)
+@MAKE_ADA_SHAREDLIB@   rm -f $(LIBDIR)/$(SHARED_LIBNAME)
+
+clean ::
        rm -rf $(BUILD_DIR)/*-ali
        rm -rf $(BUILD_DIR)/*-obj
        rm -rf $(BUILD_DIR_LIB)