4a599acb8927850d684d91e7f6a8d053e8ad4f21
[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.53 2010/11/27 22:14:16 tom Exp $
32 #
33 .SUFFIXES:
34
35 SHELL           = /bin/sh
36 VPATH           = @srcdir@
37 THIS            = Makefile
38
39 MODEL           = ../../@DFT_OBJ_SUBDIR@
40
41 DESTDIR         = @DESTDIR@
42
43 top_srcdir      = @top_srcdir@
44 srcdir          = @srcdir@
45 prefix          = @prefix@
46 exec_prefix     = @exec_prefix@
47 libdir          = ${exec_prefix}/lib
48
49 LIBDIR          = $(DESTDIR)$(libdir)
50 ADA_INCLUDE     = $(DESTDIR)@ADA_INCLUDE@
51 ADA_OBJECTS     = $(DESTDIR)@ADA_OBJECTS@
52
53 INSTALL         = @INSTALL@
54 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
55
56 AR              = @AR@
57 ARFLAGS         = @ARFLAGS@
58 AWK             = @AWK@
59 LN_S            = @LN_S@
60
61 CC              = @CC@
62 CFLAGS          = @CFLAGS@
63
64 CPPFLAGS        = @ACPPFLAGS@ \
65                   -DHAVE_CONFIG_H -I$(srcdir)
66
67 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
68
69 CFLAGS_NORMAL   = $(CCFLAGS)
70 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
71 CFLAGS_PROFILE  = $(CCFLAGS) -pg
72 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
73
74 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
75
76 LINK            = $(CC)
77 LDFLAGS         = @LDFLAGS@ @LD_MODEL@ @LIBS@
78
79 RANLIB          = @RANLIB@
80
81 ################################################################################
82 ADA             = @cf_ada_compiler@
83 ADAPREP         = gnatprep
84 ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
85
86 LIB_NAME        = AdaCurses
87 SONAME          = @ADA_SHAREDLIB@
88
89 GNAT_PROJECT    = $(srcdir)/library.gpr
90
91 # build/source are the Ada95 tree
92 BUILD_DIR       = ..
93 SOURCE_DIR      = ..
94
95 BUILD_DIR_LIB   = $(BUILD_DIR)/lib
96 SOURCE_DIR_SRC  = $(SOURCE_DIR)/src
97
98 ADAMAKE         = @cf_ada_make@
99 ADAMAKEFLAGS    = \
100         -P$(GNAT_PROJECT) \
101         -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
102         -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
103         -XSOURCE_DIR2=`cd $(srcdir);pwd` \
104         -XLIB_NAME=$(LIB_NAME) \
105         -XSONAME=$(SONAME)
106
107 CARGS           = -cargs $(ADAFLAGS)
108 LARGS           =
109
110 STATIC_LIBNAME  = lib$(LIB_NAME).a
111 SHARED_LIBNAME  = $(SONAME)
112 SHARED_SYMLINK  = lib$(LIB_NAME).so
113
114 ALIB            = @cf_ada_package@
115 ABASE           = $(ALIB)-curses
116 ################################################################################
117 GENERATED_SOURCES=$(ABASE).ads                          \
118                   $(ABASE).adb                          \
119                   $(ABASE)-aux.ads                      \
120                   $(ABASE)-trace.ads                    \
121                   $(ABASE)-menus.ads                    \
122                   $(ABASE)-forms.ads                    \
123                   $(ABASE)-mouse.ads                    \
124                   $(ABASE)-panels.ads                   \
125                   $(ABASE)-menus-menu_user_data.ads     \
126                   $(ABASE)-menus-item_user_data.ads     \
127                   $(ABASE)-forms-form_user_data.ads     \
128                   $(ABASE)-forms-field_types.ads        \
129                   $(ABASE)-forms-field_user_data.ads    \
130                   $(ABASE)-panels-user_data.ads
131 ################################################################################
132 LIBOBJS=$(ALIB).o                                       \
133         $(ABASE)-aux.o                                  \
134         $(ABASE).o                                      \
135         $(ABASE)-terminfo.o                             \
136         $(ABASE)-termcap.o                              \
137         $(ABASE)-putwin.o                               \
138         $(ABASE)-trace.o                                \
139         $(ABASE)-mouse.o                                \
140         $(ABASE)-panels.o                               \
141         $(ABASE)-menus.o                                \
142         $(ABASE)-forms.o                                \
143         $(ABASE)-forms-field_types.o                    \
144         $(ABASE)-forms-field_types-alpha.o              \
145         $(ABASE)-forms-field_types-alphanumeric.o       \
146         $(ABASE)-forms-field_types-intfield.o           \
147         $(ABASE)-forms-field_types-numeric.o            \
148         $(ABASE)-forms-field_types-regexp.o             \
149         $(ABASE)-forms-field_types-enumeration.o        \
150         $(ABASE)-forms-field_types-ipv4_address.o       \
151         $(ABASE)-forms-field_types-user.o               \
152         $(ABASE)-forms-field_types-user-choice.o        \
153         $(ABASE)-text_io.o                              \
154         $(ABASE)-text_io-aux.o
155
156 # Ada object files for generic packages. Since gnat 3.10 they are
157 # also compiled
158 GENOBJS=$(ABASE)-menus-menu_user_data.o                 \
159         $(ABASE)-menus-item_user_data.o                 \
160         $(ABASE)-forms-form_user_data.o                 \
161         $(ABASE)-forms-field_user_data.o                \
162         $(ABASE)-forms-field_types-enumeration-ada.o    \
163         $(ABASE)-panels-user_data.o                     \
164         $(ABASE)-text_io-integer_io.o                   \
165         $(ABASE)-text_io-float_io.o                     \
166         $(ABASE)-text_io-fixed_io.o                     \
167         $(ABASE)-text_io-decimal_io.o                   \
168         $(ABASE)-text_io-enumeration_io.o               \
169         $(ABASE)-text_io-modular_io.o                   \
170         $(ABASE)-text_io-complex_io.o
171
172 all ::  $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
173         @echo done
174
175 $(ADA_INCLUDE) \
176 $(ADA_OBJECTS) \
177 $(LIBDIR) \
178 $(BUILD_DIR_LIB) :
179         mkdir -p $@
180
181 sources :
182         @echo made $@
183
184 libs \
185 install \
186 install.libs :: \
187                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
188         @echo made $(STATIC_LIBNAME)
189
190 install \
191 install.libs :: \
192                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
193                 $(ADA_OBJECTS)
194         @$(INSTALL_LIB) \
195                 $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
196                 $(ADA_OBJECTS)
197
198 uninstall \
199 uninstall.libs ::
200         @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
201
202 mostlyclean ::
203         rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
204
205 clean :: mostlyclean
206         rm -f $(ABASE)-trace.adb
207
208 distclean :: clean
209         rm -f Makefile
210
211 realclean :: distclean
212
213 BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
214
215 $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
216         rm -f $@
217         $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
218
219 ###############################################################################
220
221 @USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
222 @USE_OLD_MAKERULES@             $(BUILD_DIR_LIB) \
223 @USE_OLD_MAKERULES@             $(LIBOBJS) @cf_generic_objects@
224 @USE_OLD_MAKERULES@     $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
225
226 $(BUILD_DIR)/static-ali : ; mkdir -p $@
227 $(BUILD_DIR)/static-obj : ; mkdir -p $@
228
229 STATIC_DIRS = \
230         $(BUILD_DIR_LIB) \
231         $(BUILD_DIR)/static-ali \
232         $(BUILD_DIR)/static-obj
233
234 @USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
235 @USE_GNAT_PROJECTS@             $(ABASE)-trace.adb \
236 @USE_GNAT_PROJECTS@             $(STATIC_DIRS)
237 @USE_GNAT_PROJECTS@     $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
238 @USE_GNAT_PROJECTS@
239 @USE_GNAT_PROJECTS@install \
240 @USE_GNAT_PROJECTS@install.libs :: \
241 @USE_GNAT_PROJECTS@             $(ADA_OBJECTS)
242 @USE_GNAT_PROJECTS@     $(INSTALL_LIB) \
243 @USE_GNAT_PROJECTS@             $(BUILD_DIR)/static-ali/*.ali \
244 @USE_GNAT_PROJECTS@             $(ADA_OBJECTS)
245
246 uninstall \
247 uninstall.libs ::
248         @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
249
250 @USE_GNAT_PROJECTS@uninstall \
251 @USE_GNAT_PROJECTS@uninstall.libs ::
252 @USE_GNAT_PROJECTS@     @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
253
254 $(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
255 $(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
256
257 SHARED_DIRS = \
258         $(BUILD_DIR_LIB) \
259         $(BUILD_DIR)/dynamic-ali \
260         $(BUILD_DIR)/dynamic-obj
261
262 @MAKE_ADA_SHAREDLIB@all \
263 @MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS)
264 @MAKE_ADA_SHAREDLIB@    $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
265
266 install \
267 install.libs :: $(ADA_INCLUDE)
268         $(INSTALL_LIB) \
269                 $(SOURCE_DIR_SRC)/*.ad[sb] \
270                 $(ADA_INCLUDE)
271
272 install \
273 install.libs :: $(ADA_INCLUDE)
274         $(INSTALL_LIB) \
275                 $(GENERATED_SOURCES) \
276                 $(ADA_INCLUDE)
277
278 uninstall \
279 uninstall.libs ::
280         $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done'
281
282 @MAKE_ADA_SHAREDLIB@install \
283 @MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS)
284 @MAKE_ADA_SHAREDLIB@    $(INSTALL_LIB) \
285 @MAKE_ADA_SHAREDLIB@            $(BUILD_DIR)/dynamic-ali/* \
286 @MAKE_ADA_SHAREDLIB@            $(ADA_OBJECTS)
287 @MAKE_ADA_SHAREDLIB@    $(INSTALL_LIB) \
288 @MAKE_ADA_SHAREDLIB@            $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \
289 @MAKE_ADA_SHAREDLIB@            $(LIBDIR)
290 @MAKE_ADA_SHAREDLIB@    cd $(LIBDIR) && ln -s $(SHARED_LIBNAME) $(SHARED_SYMLINK)
291 @MAKE_ADA_SHAREDLIB@
292 @MAKE_ADA_SHAREDLIB@uninstall \
293 @MAKE_ADA_SHAREDLIB@uninstall.libs ::
294 @MAKE_ADA_SHAREDLIB@    $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
295 @MAKE_ADA_SHAREDLIB@
296 @MAKE_ADA_SHAREDLIB@uninstall \
297 @MAKE_ADA_SHAREDLIB@uninstall.libs ::
298 @MAKE_ADA_SHAREDLIB@    rm -f $(LIBDIR)/$(SHARED_SYMLINK)
299 @MAKE_ADA_SHAREDLIB@    rm -f $(LIBDIR)/$(SHARED_LIBNAME)
300
301 clean ::
302         rm -rf $(BUILD_DIR)/*-ali
303         rm -rf $(BUILD_DIR)/*-obj
304         rm -rf $(BUILD_DIR_LIB)