ncurses 6.1 - patch 20190907
[ncurses.git] / Ada95 / src / Makefile.in
index d74c44579147ae9771ad77fe2871e2a935a8b953..bdfe0a81e5e78e51211da3b36c0ed779f64fd730 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2011,2014 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  $Id: Makefile.in,v 1.68 2014/05/24 21:29:11 tom Exp $
+#  $Id: Makefile.in,v 1.87 2019/09/07 20:53:06 tom Exp $
 #
 .SUFFIXES:
 
-SHELL          = /bin/sh
+SHELL          = @SHELL@
 VPATH          = @srcdir@
 THIS           = Makefile
 
+ADA_MFLAGS     = @cf_cv_makeflags@
+@SET_MAKE@
+
 MODEL          = ../../@DFT_OBJ_SUBDIR@
 
 DESTDIR                = @DESTDIR@
@@ -51,7 +54,7 @@ LIBDIR                = $(DESTDIR)$(libdir)
 ADA_INCLUDE    = $(DESTDIR)@ADA_INCLUDE@
 ADA_OBJECTS    = $(DESTDIR)@ADA_OBJECTS@
 
-INSTALL                = @INSTALL@
+INSTALL                = @INSTALL@ @INSTALL_OPT_O@
 INSTALL_LIB    = @INSTALL@ @INSTALL_LIB@
 
 AR             = @AR@
@@ -80,14 +83,14 @@ LDFLAGS             = @LDFLAGS@ @LD_MODEL@ @LIBS@
 RANLIB         = @RANLIB@
 
 ################################################################################
-ADA             = @cf_ada_compiler@
+ADA            = @cf_ada_compiler@
 ADAPREP                = gnatprep
-ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
+ADAFLAGS       = @ADAFLAGS@ -I. -I$(srcdir)
 
-LIB_NAME       = AdaCurses
+LIB_NAME       = @ADA_LIBNAME@
 SONAME         = @ADA_SHAREDLIB@
 
-GNAT_PROJECT   = $(srcdir)/library.gpr
+GNAT_PROJECT   = @ADA_LIBNAME@.gpr
 
 # build/source are the Ada95 tree
 BUILD_DIR      = ..
@@ -96,7 +99,17 @@ SOURCE_DIR   = ..
 BUILD_DIR_LIB  = $(BUILD_DIR)/lib
 SOURCE_DIR_SRC = $(SOURCE_DIR)/src
 
-ADAMAKE         = @cf_ada_make@
+ADAMAKE                = @cf_ada_make@
+ADAMAKEFLAGS   = \
+       -P$(GNAT_PROJECT) \
+       -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           =
 
 STATIC_LIBNAME = lib$(LIB_NAME).a
 SHARED_LIBNAME = $(SONAME)
@@ -169,7 +182,10 @@ $(LIBDIR) \
 $(BUILD_DIR_LIB) :
        mkdir -p $@
 
-sources :
+$(GENERATED_SOURCES) :
+       cd ../gen; $(MAKE) $(ADA_MFLAGS)
+
+sources : $(GENERATED_SOURCES)
        @echo made $@
 
 libs \
@@ -197,7 +213,7 @@ clean :: mostlyclean
        rm -f $(ABASE)-trace.adb
 
 distclean :: clean
-       rm -f Makefile
+       rm -f Makefile library.gpr
 
 realclean :: distclean
 
@@ -205,12 +221,12 @@ BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
 
 $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
        rm -f $@
-       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ $(srcdir)/$(ABASE)-trace.adb_p $@
+       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ @GNATPREP_OPTS@ $(srcdir)/$(ABASE)-trace.adb_p $@
 
 ###############################################################################
 # Use these definitions when building a shared library.
 SHARED_C_OBJS  = c_varargs_to_ada.o c_threaded_variables.o ncurses_compat.o
-SHARED_OBJS    = $(SHARED_C_OBJS) $(LIBOBJS) @cf_generic_objects@
+SHARED_OBJS    = $(SHARED_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
 
 c_varargs_to_ada.o :   $(srcdir)/c_varargs_to_ada.c
        $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c
@@ -224,7 +240,7 @@ ncurses_compat.o :  $(srcdir)/ncurses_compat.c
 ###############################################################################
 # Use these definitions when building a static library.
 STATIC_C_OBJS  = static_c_varargs_to_ada.o static_c_threaded_variables.o static_ncurses_compat.o
-STATIC_OBJS    = $(STATIC_C_OBJS) $(LIBOBJS) @cf_generic_objects@
+STATIC_OBJS    = $(STATIC_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
 
 static_c_varargs_to_ada.o :    $(srcdir)/c_varargs_to_ada.c
        $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_varargs_to_ada.c
@@ -237,10 +253,46 @@ static_ncurses_compat.o : $(srcdir)/ncurses_compat.c
 
 ###############################################################################
 
-$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
-               $(BUILD_DIR_LIB) \
-               $(STATIC_OBJS)
-       $(AR) $(ARFLAGS) $@ $(STATIC_OBJS)
+@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
+@USE_OLD_MAKERULES@            $(BUILD_DIR_LIB) \
+@USE_OLD_MAKERULES@            $(STATIC_OBJS)
+@USE_OLD_MAKERULES@    $(AR) $(ARFLAGS) $@ $(STATIC_OBJS)
+
+$(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_C_OBJS) \
+@USE_GNAT_PROJECTS@            $(STATIC_DIRS)
+@USE_GNAT_PROJECTS@    @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
+@USE_GNAT_PROJECTS@    -rm -f $(GNAT_PROJECT)
+@USE_GNAT_PROJECTS@    $(SHELL) $(srcdir)/library-cfg.sh static $(srcdir)/library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
+@USE_GNAT_PROJECTS@    @echo "Using GNAT Project:"
+@USE_GNAT_PROJECTS@    @-$(SHELL) -c "diff -u $(srcdir)/library.gpr $(GNAT_PROJECT); exit 0"
+@USE_GNAT_PROJECTS@    $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
+@USE_GNAT_PROJECTS@    $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS)
+@USE_GNAT_PROJECTS@    -rm -f $(GNAT_PROJECT)
+@USE_GNAT_PROJECTS@
+@USE_GNAT_LIBRARIES@install \
+@USE_GNAT_LIBRARIES@install.libs :: \
+@USE_GNAT_LIBRARIES@           $(ADA_OBJECTS)
+@USE_GNAT_LIBRARIES@   $(INSTALL_LIB) \
+@USE_GNAT_LIBRARIES@           $(BUILD_DIR)/static-ali/*.ali \
+@USE_GNAT_LIBRARIES@           $(ADA_OBJECTS)
+
+uninstall \
+uninstall.libs ::
+       @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
+
+@USE_GNAT_LIBRARIES@uninstall \
+@USE_GNAT_LIBRARIES@uninstall.libs ::
+@USE_GNAT_LIBRARIES@   @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
 
 $(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
 $(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
@@ -250,29 +302,19 @@ SHARED_DIRS = \
        $(BUILD_DIR)/dynamic-ali \
        $(BUILD_DIR)/dynamic-obj
 
-GPR_EMPTY :=
-GPR_SPACE := $(GPR_EMPTY) $(GPR_EMPTY)
-GPR_COMMA := ,
-GPR_LIST = ("$(subst $(GPR_SPACE),"$(GPR_COMMA) ",$(strip $(1)))")
-$(GNAT_PROJECT) : $(GNAT_PROJECT).sed
-       sed \
-       -e "s|External (\"BUILD_DIR\")|\"`cd $(BUILD_DIR);pwd`\"|" \
-       -e 's/External ("LIB_NAME")/"$(LIB_NAME)"/' \
-       -e 's/External ("SONAME")/"$(SONAME)"/' \
-       -e 's/External_As_List\ ("ADAFLAGS", " ")/$(call GPR_LIST,$(ADAFLAGS))/' \
-       -e 's/External_As_List\ ("LDFLAGS", " ")/$(call GPR_LIST,$(LDFLAGS))/' \
-       $< > $@
-clean ::
-       rm -rf $(GNAT_PROJECT)
-
 @MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME)
 @MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \
-@MAKE_ADA_SHAREDLIB@           $(GNAT_PROJECT) \
 @MAKE_ADA_SHAREDLIB@           $(ABASE)-trace.adb \
 @MAKE_ADA_SHAREDLIB@           $(SHARED_DIRS) \
 @MAKE_ADA_SHAREDLIB@           $(SHARED_OBJS)
 @MAKE_ADA_SHAREDLIB@   cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/
-@MAKE_ADA_SHAREDLIB@   $(ADAMAKE) -P$(GNAT_PROJECT)
+@MAKE_ADA_SHAREDLIB@   @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
+@MAKE_ADA_SHAREDLIB@   -rm -f $(GNAT_PROJECT)
+@MAKE_ADA_SHAREDLIB@   $(SHELL) $(srcdir)/library-cfg.sh dynamic $(srcdir)/library.gpr $(CFLAGS_SHARED) >$(GNAT_PROJECT)
+@MAKE_ADA_SHAREDLIB@   @echo "Making Ada shared-lib:"
+@MAKE_ADA_SHAREDLIB@   @-$(SHELL) -c "diff -u $(srcdir)/library.gpr $(GNAT_PROJECT); exit 0"
+@MAKE_ADA_SHAREDLIB@   $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
+@MAKE_ADA_SHAREDLIB@   -rm -f $(GNAT_PROJECT)
 
 install \
 install.libs :: $(ADA_INCLUDE)
@@ -310,6 +352,7 @@ uninstall.libs ::
 @MAKE_ADA_SHAREDLIB@   rm -f $(LIBDIR)/$(SHARED_LIBNAME)
 
 clean ::
-       rm -rf $(BUILD_DIR)/dynamic-ali
-       rm -rf $(BUILD_DIR)/dynamic-obj
-       rm -rf $(BUILD_DIR_LIB)
+       -rm -f default.cgpr
+       -rm -rf $(BUILD_DIR)/*-ali
+       -rm -rf $(BUILD_DIR)/*-obj
+       -rm -rf $(BUILD_DIR_LIB)