ncurses 6.2 - patch 20200328
[ncurses.git] / Ada95 / src / Makefile.in
1 ##############################################################################
2 # Copyright 2018-2019,2020 Thomas E. Dickey                                  #
3 # Copyright 1999-2016,2018 Free Software Foundation, Inc.                    #
4 #                                                                            #
5 # Permission is hereby granted, free of charge, to any person obtaining a    #
6 # copy of this software and associated documentation files (the "Software"), #
7 # to deal in the Software without restriction, including without limitation  #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the  #
11 # following conditions:                                                      #
12 #                                                                            #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software.                        #
15 #                                                                            #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
22 # DEALINGS IN THE SOFTWARE.                                                  #
23 #                                                                            #
24 # Except as contained in this notice, the name(s) of the above copyright     #
25 # holders shall not be used in advertising or otherwise to promote the sale, #
26 # use or other dealings in this Software without prior written               #
27 # authorization.                                                             #
28 ##############################################################################
29 #
30 #  Author:  Juergen Pfeifer, 1996
31 #
32 #  $Id: Makefile.in,v 1.90 2020/03/28 18:05:56 Adam.Van.Ymeren Exp $
33 #
34 .SUFFIXES:
35
36 SHELL           = @SHELL@
37 VPATH           = @srcdir@
38 THIS            = Makefile
39
40 ADA_MFLAGS      = @cf_cv_makeflags@
41 @SET_MAKE@
42
43 MODEL           = ../../@DFT_OBJ_SUBDIR@
44
45 DESTDIR         = @DESTDIR@
46
47 top_srcdir      = @top_srcdir@
48 srcdir          = @srcdir@
49 prefix          = @prefix@
50 exec_prefix     = @exec_prefix@
51 includedir      = @includedir@
52 libdir          = @libdir@
53
54 LIBDIR          = $(DESTDIR)$(libdir)
55 ADA_INCLUDE     = $(DESTDIR)@ADA_INCLUDE@
56 ADA_OBJECTS     = $(DESTDIR)@ADA_OBJECTS@
57
58 INSTALL         = @INSTALL@ @INSTALL_OPT_O@
59 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
60
61 AR              = @AR@
62 ARFLAGS         = @ARFLAGS@
63 AWK             = @AWK@
64 LN_S            = @LN_S@
65
66 CC              = @CC@
67 CFLAGS          = @CFLAGS@
68
69 CPPFLAGS        = @ACPPFLAGS@ @CPPFLAGS@ \
70                   -DHAVE_CONFIG_H -I$(srcdir)
71
72 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
73
74 CFLAGS_NORMAL   = $(CCFLAGS)
75 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
76 CFLAGS_PROFILE  = $(CCFLAGS) -pg
77 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
78
79 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
80
81 LINK            = $(CC)
82 LDFLAGS         = @LDFLAGS@ @LD_MODEL@ @LIBS@
83
84 RANLIB          = @RANLIB@
85
86 ################################################################################
87 ADA             = @cf_ada_compiler@
88 ADAPREP         = gnatprep
89 ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
90
91 LIB_NAME        = @ADA_LIBNAME@
92 SONAME          = @ADA_SHAREDLIB@
93
94 GNAT_PROJECT    = @ADA_LIBNAME@.gpr
95
96 # build/source are the Ada95 tree
97 BUILD_DIR       = ..
98 SOURCE_DIR      = ..
99
100 BUILD_DIR_LIB   = $(BUILD_DIR)/lib
101 SOURCE_DIR_SRC  = $(SOURCE_DIR)/src
102
103 ADAMAKE         = @cf_ada_make@
104 ADAMAKEFLAGS    = \
105         -P$(GNAT_PROJECT) \
106         -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
107         -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
108         -XSOURCE_DIR2=`cd $(srcdir);pwd` \
109         -XLIB_NAME=$(LIB_NAME) \
110         -XSONAME=$(SONAME)
111
112 CARGS           = -cargs $(ADAFLAGS)
113 LARGS           =
114
115 STATIC_LIBNAME  = lib$(LIB_NAME).a
116 SHARED_LIBNAME  = $(SONAME)
117 SHARED_SYMLINK  = lib$(LIB_NAME).so
118
119 ALIB            = @cf_ada_package@
120 ABASE           = $(ALIB)-curses
121 ################################################################################
122 GENERATED_SOURCES=$(ABASE).ads                          \
123                   $(ABASE).adb                          \
124                   $(ABASE)-aux.ads                      \
125                   $(ABASE)-trace.ads                    \
126                   $(ABASE)-menus.ads                    \
127                   $(ABASE)-forms.ads                    \
128                   $(ABASE)-mouse.ads                    \
129                   $(ABASE)-panels.ads                   \
130                   $(ABASE)-menus-menu_user_data.ads     \
131                   $(ABASE)-menus-item_user_data.ads     \
132                   $(ABASE)-forms-form_user_data.ads     \
133                   $(ABASE)-forms-field_types.ads        \
134                   $(ABASE)-forms-field_user_data.ads    \
135                   $(ABASE)-panels-user_data.ads
136 ################################################################################
137 LIBOBJS=$(ALIB).o                                       \
138         $(ABASE)-aux.o                                  \
139         $(ABASE).o                                      \
140         $(ABASE)-terminfo.o                             \
141         $(ABASE)-termcap.o                              \
142         $(ABASE)-putwin.o                               \
143         $(ABASE)-trace.o                                \
144         $(ABASE)-mouse.o                                \
145         $(ABASE)-panels.o                               \
146         $(ABASE)-menus.o                                \
147         $(ABASE)-forms.o                                \
148         $(ABASE)-forms-field_types.o                    \
149         $(ABASE)-forms-field_types-alpha.o              \
150         $(ABASE)-forms-field_types-alphanumeric.o       \
151         $(ABASE)-forms-field_types-intfield.o           \
152         $(ABASE)-forms-field_types-numeric.o            \
153         $(ABASE)-forms-field_types-regexp.o             \
154         $(ABASE)-forms-field_types-enumeration.o        \
155         $(ABASE)-forms-field_types-ipv4_address.o       \
156         $(ABASE)-forms-field_types-user.o               \
157         $(ABASE)-forms-field_types-user-choice.o        \
158         $(ABASE)-text_io.o                              \
159         $(ABASE)-text_io-aux.o
160
161 # Ada object files for generic packages. Since gnat 3.10 they are
162 # also compiled
163 GENOBJS=$(ABASE)-menus-menu_user_data.o                 \
164         $(ABASE)-menus-item_user_data.o                 \
165         $(ABASE)-forms-form_user_data.o                 \
166         $(ABASE)-forms-field_user_data.o                \
167         $(ABASE)-forms-field_types-enumeration-ada.o    \
168         $(ABASE)-panels-user_data.o                     \
169         $(ABASE)-text_io-integer_io.o                   \
170         $(ABASE)-text_io-float_io.o                     \
171         $(ABASE)-text_io-fixed_io.o                     \
172         $(ABASE)-text_io-decimal_io.o                   \
173         $(ABASE)-text_io-enumeration_io.o               \
174         $(ABASE)-text_io-modular_io.o                   \
175         $(ABASE)-text_io-complex_io.o
176
177 all ::  $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
178         @echo done
179
180 $(ADA_INCLUDE) \
181 $(ADA_OBJECTS) \
182 $(LIBDIR) \
183 $(BUILD_DIR_LIB) :
184         mkdir -p $@
185
186 $(GENERATED_SOURCES) :
187         cd ../gen; $(MAKE) $(ADA_MFLAGS)
188
189 sources : $(GENERATED_SOURCES)
190         @echo made $@
191
192 libs \
193 install \
194 install.libs :: \
195                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
196         @echo made $(STATIC_LIBNAME)
197
198 install \
199 install.libs :: \
200                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
201                 $(ADA_OBJECTS)
202         @$(INSTALL_LIB) \
203                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
204                 $(ADA_OBJECTS)
205
206 uninstall \
207 uninstall.libs ::
208         @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
209
210 mostlyclean ::
211         rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
212
213 clean :: mostlyclean
214         rm -f $(ABASE)-trace.adb
215
216 distclean :: clean
217         rm -f Makefile library.gpr
218
219 realclean :: distclean
220
221 BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
222
223 $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
224         rm -f $@
225         $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ @GNATPREP_OPTS@ $(srcdir)/$(ABASE)-trace.adb_p $@
226
227 ###############################################################################
228 # Use these definitions when building a shared library.
229 SHARED_C_OBJS   = c_varargs_to_ada.o c_threaded_variables.o ncurses_compat.o
230 SHARED_OBJS     = $(SHARED_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
231
232 c_varargs_to_ada.o :    $(srcdir)/c_varargs_to_ada.c
233         $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c
234
235 c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
236         $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_threaded_variables.c
237
238 ncurses_compat.o :      $(srcdir)/ncurses_compat.c
239         $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c
240
241 ###############################################################################
242 # Use these definitions when building a static library.
243 STATIC_C_OBJS   = static_c_varargs_to_ada.o static_c_threaded_variables.o static_ncurses_compat.o
244 STATIC_OBJS     = $(STATIC_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
245
246 static_c_varargs_to_ada.o :     $(srcdir)/c_varargs_to_ada.c
247         $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_varargs_to_ada.c
248
249 static_c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
250         $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_threaded_variables.c
251
252 static_ncurses_compat.o :       $(srcdir)/ncurses_compat.c
253         $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/ncurses_compat.c
254
255 ###############################################################################
256
257 @USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
258 @USE_OLD_MAKERULES@             $(BUILD_DIR_LIB) \
259 @USE_OLD_MAKERULES@             $(STATIC_OBJS)
260 @USE_OLD_MAKERULES@     $(AR) $(ARFLAGS) $@ $(STATIC_OBJS)
261
262 $(BUILD_DIR)/static-ali : ; mkdir -p $@
263 $(BUILD_DIR)/static-obj : ; mkdir -p $@
264
265 STATIC_DIRS = \
266         $(BUILD_DIR_LIB) \
267         $(BUILD_DIR)/static-ali \
268         $(BUILD_DIR)/static-obj
269
270 @USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
271 @USE_GNAT_PROJECTS@             $(ABASE)-trace.adb \
272 @USE_GNAT_PROJECTS@             $(STATIC_C_OBJS) \
273 @USE_GNAT_PROJECTS@             $(STATIC_DIRS)
274 @USE_GNAT_PROJECTS@     @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
275 @USE_GNAT_PROJECTS@     -rm -f $(GNAT_PROJECT)
276 @USE_GNAT_PROJECTS@     $(SHELL) $(srcdir)/library-cfg.sh static library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
277 @USE_GNAT_PROJECTS@     @echo "Using GNAT Project:"
278 @USE_GNAT_PROJECTS@     @-$(SHELL) -c "diff -c library.gpr $(GNAT_PROJECT); exit 0"
279 @USE_GNAT_PROJECTS@     $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
280 @USE_GNAT_PROJECTS@     $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS)
281 @USE_GNAT_PROJECTS@     -rm -f $(GNAT_PROJECT)
282 @USE_GNAT_PROJECTS@
283 @USE_GNAT_LIBRARIES@install \
284 @USE_GNAT_LIBRARIES@install.libs :: \
285 @USE_GNAT_LIBRARIES@            $(ADA_OBJECTS)
286 @USE_GNAT_LIBRARIES@    $(INSTALL_LIB) \
287 @USE_GNAT_LIBRARIES@            $(BUILD_DIR)/static-ali/*.ali \
288 @USE_GNAT_LIBRARIES@            $(ADA_OBJECTS)
289
290 uninstall \
291 uninstall.libs ::
292         @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
293
294 @USE_GNAT_LIBRARIES@uninstall \
295 @USE_GNAT_LIBRARIES@uninstall.libs ::
296 @USE_GNAT_LIBRARIES@    @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
297
298 $(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
299 $(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
300
301 SHARED_DIRS = \
302         $(BUILD_DIR_LIB) \
303         $(BUILD_DIR)/dynamic-ali \
304         $(BUILD_DIR)/dynamic-obj
305
306 @MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME)
307 @MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \
308 @MAKE_ADA_SHAREDLIB@            $(ABASE)-trace.adb \
309 @MAKE_ADA_SHAREDLIB@            $(SHARED_DIRS) \
310 @MAKE_ADA_SHAREDLIB@            $(SHARED_OBJS)
311 @MAKE_ADA_SHAREDLIB@    cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/
312 @MAKE_ADA_SHAREDLIB@    @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
313 @MAKE_ADA_SHAREDLIB@    -rm -f $(GNAT_PROJECT)
314 @MAKE_ADA_SHAREDLIB@    $(SHELL) $(srcdir)/library-cfg.sh dynamic library.gpr $(CFLAGS_SHARED) >$(GNAT_PROJECT)
315 @MAKE_ADA_SHAREDLIB@    @echo "Making Ada shared-lib:"
316 @MAKE_ADA_SHAREDLIB@    @-$(SHELL) -c "diff -c library.gpr $(GNAT_PROJECT); exit 0"
317 @MAKE_ADA_SHAREDLIB@    $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
318 @MAKE_ADA_SHAREDLIB@    -rm -f $(GNAT_PROJECT)
319
320 install \
321 install.libs :: $(ADA_INCLUDE)
322         $(INSTALL_LIB) \
323                 $(SOURCE_DIR_SRC)/*.ad[sb] \
324                 $(ADA_INCLUDE)
325
326 install \
327 install.libs :: $(ADA_INCLUDE)
328         $(INSTALL_LIB) \
329                 $(GENERATED_SOURCES) \
330                 $(ADA_INCLUDE)
331
332 uninstall \
333 uninstall.libs ::
334         $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done'
335
336 @MAKE_ADA_SHAREDLIB@install \
337 @MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) $(LIBDIR)
338 @MAKE_ADA_SHAREDLIB@    $(INSTALL_LIB) \
339 @MAKE_ADA_SHAREDLIB@            $(BUILD_DIR)/dynamic-ali/* \
340 @MAKE_ADA_SHAREDLIB@            $(ADA_OBJECTS)
341 @MAKE_ADA_SHAREDLIB@    $(INSTALL_LIB) \
342 @MAKE_ADA_SHAREDLIB@            $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \
343 @MAKE_ADA_SHAREDLIB@            $(LIBDIR)
344 @MAKE_ADA_SHAREDLIB@    cd $(LIBDIR) && $(LN_S) $(SHARED_LIBNAME) $(SHARED_SYMLINK)
345 @MAKE_ADA_SHAREDLIB@
346 @MAKE_ADA_SHAREDLIB@uninstall \
347 @MAKE_ADA_SHAREDLIB@uninstall.libs ::
348 @MAKE_ADA_SHAREDLIB@    $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
349 @MAKE_ADA_SHAREDLIB@
350 @MAKE_ADA_SHAREDLIB@uninstall \
351 @MAKE_ADA_SHAREDLIB@uninstall.libs ::
352 @MAKE_ADA_SHAREDLIB@    rm -f $(LIBDIR)/$(SHARED_SYMLINK)
353 @MAKE_ADA_SHAREDLIB@    rm -f $(LIBDIR)/$(SHARED_LIBNAME)
354
355 clean ::
356         -rm -f default.cgpr
357         -rm -rf $(BUILD_DIR)/*-ali
358         -rm -rf $(BUILD_DIR)/*-obj
359         -rm -rf $(BUILD_DIR_LIB)