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