aboutsummaryrefslogtreecommitdiff
path: root/Ada95/gen/Makefile.in
blob: 446f8bdf8e8967fc22b2e9dc52e94cc14499872c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
##############################################################################
# Copyright 2019,2020 Thomas E. Dickey                                       #
# Copyright 1998-2015,2018 Free Software Foundation, Inc.                    #
#                                                                            #
# Permission is hereby granted, free of charge, to any person obtaining a    #
# copy of this software and associated documentation files (the "Software"), #
# to deal in the Software without restriction, including without limitation  #
# the rights to use, copy, modify, merge, publish, distribute, distribute    #
# with modifications, sublicense, and/or sell copies of the Software, and to #
# permit persons to whom the Software is furnished to do so, subject to the  #
# following conditions:                                                      #
#                                                                            #
# The above copyright notice and this permission notice shall be included in #
# all copies or substantial portions of the Software.                        #
#                                                                            #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
# DEALINGS IN THE SOFTWARE.                                                  #
#                                                                            #
# Except as contained in this notice, the name(s) of the above copyright     #
# holders shall not be used in advertising or otherwise to promote the sale, #
# use or other dealings in this Software without prior written               #
# authorization.                                                             #
##############################################################################
#
#  Author:  Juergen Pfeifer, 1996
#
#  $Id: Makefile.in,v 1.90 2020/02/02 23:34:34 tom Exp $
#
.SUFFIXES:

SHELL		= @SHELL@
VPATH		= @srcdir@
THIS		= Makefile

x		= @EXEEXT@

top_srcdir	= @top_srcdir@
DESTDIR		= @DESTDIR@
srcdir		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
bindir		= @bindir@
includedir	= @includedir@

INSTALL		= @INSTALL@ @INSTALL_OPT_O@
INSTALL_SCRIPT	= @INSTALL_SCRIPT@
INSTALL_DATA	= @INSTALL_DATA@

AWK		= @AWK@
LN_S		= @LN_S@

CC		= @CC@
HOST_CC		= @BUILD_CC@

CFLAGS		= @CFLAGS@
HOST_CFLAGS	= @BUILD_CFLAGS@

CPPFLAGS	= @CPPFLAGS@
HOST_CPPFLAGS	= @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
		  -DHAVE_CONFIG_H -I$(srcdir)

CCFLAGS		= $(HOST_CPPFLAGS) $(HOST_CFLAGS)
CFLAGS_NORMAL	= $(CCFLAGS)
CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE	= $(CCFLAGS) -pg
CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@

CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)

REL_VERSION	= @cf_cv_rel_version@
ABI_VERSION	= @cf_cv_abi_version@
LOCAL_LIBDIR	= @top_builddir@/lib

LINK		= $(HOST_CC)
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

# For the wide-character configuration combined with broken_linker, we need
# addresses of ACS_xxx constants, which requires linking with the newly built
# ncurses library.  If cross-compiling, the developer has to fill in a workable
# native library for this purpose.
NATIVE_LDFLAGS	= @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
CROSS_LDFLAGS	= @BUILD_LDFLAGS@ @BUILD_LIBS@

ACTUAL_LDFLAGS	= @ADAGEN_LDFLAGS@

RANLIB		= @RANLIB@

M4		= m4
M4FLAGS		= -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@

ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config

WRAPPER		= @NCURSES_SHLIB2@

PROG_GENERATE	= ./generate$x
GENERATE	= $(PROG_GENERATE) '@USE_ARG_SUFFIX@'
DEL_ADAMODE	= sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'

GNATHTML	= `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
GNATHP          = www.gnat.com

################################################################################
ALIB            = @cf_ada_package@
ABASE		= $(ALIB)-curses

ADA_SRCDIR	= ../src

GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads         			\
		  $(ADA_SRCDIR)/$(ABASE).adb         			\
	          $(ADA_SRCDIR)/$(ABASE)-aux.ads   			\
	          $(ADA_SRCDIR)/$(ABASE)-trace.ads   			\
	          $(ADA_SRCDIR)/$(ABASE)-menus.ads   			\
	          $(ADA_SRCDIR)/$(ABASE)-forms.ads   			\
	          $(ADA_SRCDIR)/$(ABASE)-mouse.ads 			\
	          $(ADA_SRCDIR)/$(ABASE)-panels.ads			\
	          $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads	\
	          $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads	\
	          $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads	\
	          $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads		\
	          $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads	\
	          $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads           \
                  $(ADA_SRCDIR)/$(ABASE)_constants.ads

GEN_SRC		= $(srcdir)/$(ABASE).ads.m4				\
		  $(srcdir)/$(ABASE).adb.m4				\
	          $(srcdir)/$(ABASE)-aux.ads.m4 	  		\
	          $(srcdir)/$(ABASE)-trace.ads.m4 	  		\
	          $(srcdir)/$(ABASE)-menus.ads.m4 	  		\
	          $(srcdir)/$(ABASE)-forms.ads.m4   			\
	          $(srcdir)/$(ABASE)-mouse.ads.m4			\
	          $(srcdir)/$(ABASE)-panels.ads.m4			\
	          $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4	\
	          $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4	\
	          $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4	\
	          $(srcdir)/$(ABASE)-forms-field_types.ads.m4		\
	          $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4	\
	          $(srcdir)/$(ABASE)-panels-user_data.ads.m4


all \
libs :	$(GEN_TARGETS)
	@echo made $@

sources:

$(DESTDIR)$(bindir) :
	mkdir -p $@

install \
install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
	$(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)

uninstall \
uninstall.libs ::
	-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)

$(PROG_GENERATE):  gen.o
	@ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@

gen.o:	$(srcdir)/gen.c
	$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c

$(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
	$(WRAPPER) "$(GENERATE)" >$@
################################################################################
$(ADA_SRCDIR)/$(ABASE).ads: 	$(srcdir)/$(ABASE).ads.m4 \
				$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE).ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE).adb: 	$(srcdir)/$(ABASE).adb.m4 \
				$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE).adb.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
				$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-aux.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
				  $(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-trace.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
				  $(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-menus.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
				  $(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-forms.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
				  $(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-mouse.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
				   $(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-panels.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
		$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
		$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
		$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
		$(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
		$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
	$(DEL_ADAMODE) >$@

$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
		$(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
		$(srcdir)/normal.m4
	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
	$(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
	$(DEL_ADAMODE) >$@

install.progs ::

tags:
	ctags *.[ch]

@MAKE_UPPER_TAGS@TAGS:
@MAKE_UPPER_TAGS@	etags *.[ch]

mostlyclean ::
	-rm -f a.out core $(PROG_GENERATE) *.o

clean :: mostlyclean
	-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp

distclean :: clean
	-rm -f $(ADACURSES_CONFIG)
	-rm -f Makefile

realclean :: distclean

HTML_DIR = @ADAHTML_DIR@

instab.tmp : table.m4 $(GEN_SRC)
	@rm -f $@
	@for f in $(GEN_SRC) ; do \
	  $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
	done;

$(HTML_DIR)/table.html : instab.tmp
	@-touch $@
	@-chmod +w $@
	@echo '<!DOCTYPE HTML'  > $@
	@echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
	@echo '<HTML>' >> $@
	@echo '<HEAD>' >> $@
	@echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
	@echo '</HEAD>' >> $@
	@echo '<BODY>' >> $@
	@echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
	@echo '<H2>Sorted by C function name</H2>' >>$@
	@echo '<TABLE ALIGN=CENTER BORDER>' >>$@
	@echo '<TR ALIGN=LEFT>' >>$@
	@echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
	@sort < instab.tmp >> $@
	@echo '</TABLE></BODY></HTML>' >>$@
	@rm -f instab.tmp

adahtml:
	test -n "$(GNATHTML)" || exit 1
	@find $(HTML_DIR) -type f -exec rm -f {} \;
	@mkdir -p $(HTML_DIR)
	cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
@USE_OLD_MAKERULES@	ln -sf ../src/*.ali .
@USE_GNAT_PROJECTS@	ln -sf ../static-ali/*.ali .
	@echo "Filtering generated files"
	@for f in $(GEN_SRC); do \
	   h=`basename $$f` ;\
	   g=`basename $$f .ads.m4` ;\
	   if test "$$g" != "$$h" ; then \
	      $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
	      echo "... $$g.ads" ;\
	   fi \
	done
	@-rm -f $(HTML_DIR)/$(ALIB)*.htm*
	$(GNATHTML) -d -f $(ALIB)*.ads
	for f in html/$(ALIB)*.htm*; do \
	   a=`basename $$f` ; \
	   sed -e 's/You may also.*body.*//' <$$f |\
	   sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
	   sed -e 's%&lt;A HREF%<A HREF%g' |\
	   sed -e 's%"&gt;%">%g' |\
	   sed -e 's%#1A\([[:space:]]*NAME="[^"]*"\)#2%<A\1>%' |\
	   sed -e 's%#1/A#2%</A>%' |\
	   sed -e 's/3X/3x/g' |\
	   sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
	   sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
	   mv $$a.tmp $$f ;\
	done
	@rm -f *.ad[sb] *.ali *.tmp
	@for f in funcs.htm main.htm ; do \
	  sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
	  mv $$f html/$$f ;\
	done
	@rm -f "html/funcs/ .htm"
	@cp -pdrf html/* $(HTML_DIR)/
	@rm -rf html

html : adahtml $(HTML_DIR)/table.html
	@echo made $@

###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################