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