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