blob: 3731085a3e51ac0f67ca482105738d650c1fe521 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301##############################################################################
micky3879b9f5e72025-07-08 18:04:53 -04002# Copyright 2018-2020,2021 Thomas E. Dickey #
3# Copyright 1998-2015,2018 Free Software Foundation, Inc. #
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304# #
5# Permission is hereby granted, free of charge, to any person obtaining a #
6# copy of this software and associated documentation files (the "Software"), #
7# to deal in the Software without restriction, including without limitation #
8# the rights to use, copy, modify, merge, publish, distribute, distribute #
9# with modifications, sublicense, and/or sell copies of the Software, and to #
10# permit persons to whom the Software is furnished to do so, subject to the #
11# following conditions: #
12# #
13# The above copyright notice and this permission notice shall be included in #
14# all copies or substantial portions of the Software. #
15# #
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
19# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
21# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
22# DEALINGS IN THE SOFTWARE. #
23# #
24# Except as contained in this notice, the name(s) of the above copyright #
25# holders shall not be used in advertising or otherwise to promote the sale, #
26# use or other dealings in this Software without prior written #
27# authorization. #
28##############################################################################
29#
30# Author: Juergen Pfeifer, 1996
31#
micky3879b9f5e72025-07-08 18:04:53 -040032# $Id: Makefile.in,v 1.64 2021/07/03 15:45:33 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053033#
34.SUFFIXES:
35
Steve Kondikae271bc2015-11-15 02:50:53 +010036SHELL = @SHELL@
37VPATH = @srcdir@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053038THIS = Makefile
39
Steve Kondikae271bc2015-11-15 02:50:53 +010040x = @EXEEXT@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053041
42srcdir = @srcdir@
43prefix = @prefix@
44exec_prefix = @exec_prefix@
Steve Kondikae271bc2015-11-15 02:50:53 +010045bindir = @bindir@
46datarootdir = @datarootdir@
47datadir = @datadir@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048libdir = @libdir@
49includedir = @includedir@
50
micky3879b9f5e72025-07-08 18:04:53 -040051INSTALL = @INSTALL@ @INSTALL_OPT_O@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053052INSTALL_DATA = @INSTALL_DATA@
53
54AWK = @AWK@
55LN_S = @LN_S@
56
57CC = @CC@
micky3879b9f5e72025-07-08 18:04:53 -040058CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059
60CPPFLAGS = @ACPPFLAGS@ \
61 -DHAVE_CONFIG_H -I$(srcdir)
62
63CCFLAGS = $(CPPFLAGS) $(CFLAGS)
64
micky3879b9f5e72025-07-08 18:04:53 -040065CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC
66CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
67CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053068CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
69
70CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
71
72REL_VERSION = @cf_cv_rel_version@
73ABI_VERSION = @cf_cv_abi_version@
74LOCAL_LIBDIR = @top_builddir@/lib
75
76LINK = $(CC)
77LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
78
79RANLIB = @RANLIB@
80################################################################################
Steve Kondikae271bc2015-11-15 02:50:53 +010081BINDIR = $(DESTDIR)$(bindir)
82DATADIR = $(DESTDIR)$(datadir)
83LIBDIR = $(DESTDIR)$(libdir)
84
micky3879b9f5e72025-07-08 18:04:53 -040085MY_DATADIR = $(DATADIR)/@ADA_LIBNAME@
86THIS_DATADIR = $(datadir)/@ADA_LIBNAME@
Steve Kondikae271bc2015-11-15 02:50:53 +010087
88################################################################################
micky3879b9f5e72025-07-08 18:04:53 -040089ada_srcdir = ../src
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090
micky3879b9f5e72025-07-08 18:04:53 -040091LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053092
micky3879b9f5e72025-07-08 18:04:53 -040093ADA = @cf_ada_compiler@
94ADAPREP = gnatprep
95ADAFLAGS = @ADAFLAGS@ -I$(srcdir)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053096
micky3879b9f5e72025-07-08 18:04:53 -040097ADAMAKE = @cf_ada_make@
98ADAMAKEFLAGS = -a \
99 -A$(srcdir) \
100 -A$(ada_srcdir) \
101 -A$(srcdir)/$(ada_srcdir)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102
micky3879b9f5e72025-07-08 18:04:53 -0400103ALIB = @cf_ada_package@
104ABASE = $(ALIB)-curses
105THISLIB = sample
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530106
micky3879b9f5e72025-07-08 18:04:53 -0400107CARGS = -cargs $(ADAFLAGS)
108LARGS = -largs -L../lib -l@ADA_LIBNAME@ @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530109
micky3879b9f5e72025-07-08 18:04:53 -0400110PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
111
112################################################################################
113
114@MAKE_PHONY@.PHONY : all
115@MAKE_PHONY@.PHONY : clean
116@MAKE_PHONY@.PHONY : distclean
117@MAKE_PHONY@.PHONY : install
118@MAKE_PHONY@.PHONY : install.examples
119@MAKE_PHONY@.PHONY : install.libs
120@MAKE_PHONY@.PHONY : libs
121@MAKE_PHONY@.PHONY : mostlyclean
122@MAKE_PHONY@.PHONY : realclean
123@MAKE_PHONY@.PHONY : sources
124@MAKE_PHONY@.PHONY : uninstall
125@MAKE_PHONY@.PHONY : uninstall.examples
126@MAKE_PHONY@.PHONY : uninstall.libs
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530127
Steve Kondikae271bc2015-11-15 02:50:53 +0100128all :: $(PROGS)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530129 @echo made $@
130
131sources :
132 @echo made $@
133
134libs \
135install \
136install.libs ::
137 @echo made $@
138
139uninstall \
140uninstall.libs ::
141 @echo made $@
142
Steve Kondikae271bc2015-11-15 02:50:53 +0100143install.examples :: $(BINDIR) $(PROGS)
144 $(INSTALL) $(PROGS) $(BINDIR)
145
146install.examples :: $(MY_DATADIR)
147 $(INSTALL_DATA) explain.txt $(MY_DATADIR)
148
149uninstall.examples ::
micky3879b9f5e72025-07-08 18:04:53 -0400150 -( cd $(BINDIR) && rm -f $(PROGS) )
Steve Kondikae271bc2015-11-15 02:50:53 +0100151 -rmdir $(BINDIR)
152 -rm -f $(MY_DATADIR)/explain.txt
153 -rmdir $(MY_DATADIR)
154
155$(BINDIR) \
156$(MY_DATADIR) :
157 mkdir -p $@
158
micky3879b9f5e72025-07-08 18:04:53 -0400159AUTO_SRC = $(THISLIB)-explanation.adb
160
161ncurses$x : $(AUTO_SRC)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530162 $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS)
163
micky3879b9f5e72025-07-08 18:04:53 -0400164tour$x : $(AUTO_SRC)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530165 $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS)
166
micky3879b9f5e72025-07-08 18:04:53 -0400167rain$x : $(AUTO_SRC)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530168 $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS)
169
170mostlyclean:
171 @echo made $@
172
173clean :: mostlyclean
174 rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
micky3879b9f5e72025-07-08 18:04:53 -0400175 rm -f $(AUTO_SRC)
176 rm -f trace screendump b~*.ad[bs]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530177
178distclean :: clean
179 rm -f Makefile
180
181realclean :: distclean
182 @echo made $@
micky3879b9f5e72025-07-08 18:04:53 -0400183
184$(THISLIB)-explanation.adb : $(srcdir)/$(THISLIB)-explanation.adb_p
185 rm -f $@
186 $(AWK) -v this_datadir=$(THIS_DATADIR) -f $(srcdir)/split-path.awk < $(srcdir)/$(THISLIB)-explanation.adb_p >$@