Debian Codegraph @

libgm2/libm2pim/Makefile.am

raw
1 # Makefile for libm2pim.
2 # Copyright 2013-2022 Free Software Foundation, Inc.
3 #
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
17
18 SUFFIXES = .c .mod .def .o .obj .lo .a .la
19
20 ACLOCAL_AMFLAGS = -I .. -I ../config
21
22 VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs
23
24 # Multilib support.
25 MAKEOVERRIDES=
26
27 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
28
29 # Directory in which the compiler finds libraries etc.
30 libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
31 # Used to install the shared libgcc.
32 slibdir = @slibdir@
33
34 toolexeclibdir=@toolexeclibdir@
35 toolexecdir=@toolexecdir@
36
37 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
38 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
39
40 MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
41 inst_libdir = $(libsubdir)$(MULTISUBDIR)
42 inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
43
44
45 # Work around what appears to be a GNU make bug handling MAKEFLAGS
46 # values defined in terms of make variables, as is the case for CC and
47 # friends when we are called from the top level Makefile.
48 AM_MAKEFLAGS = \
49 "GCC_DIR=$(GCC_DIR)" \
50 "GM2_SRC=$(GM2_SRC)" \
51 "AR_FLAGS=$(AR_FLAGS)" \
52 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
53 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
54 "GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
55 "CFLAGS=$(CFLAGS)" \
56 "CXXFLAGS=$(CXXFLAGS)" \
57 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
58 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
59 "INSTALL=$(INSTALL)" \
60 "INSTALL_DATA=$(INSTALL_DATA)" \
61 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
62 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
63 "LDFLAGS=$(LDFLAGS)" \
64 "LIBCFLAGS=$(LIBCFLAGS)" \
65 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
66 "MAKE=$(MAKE)" \
67 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
68 "MULTISUBDIR=$(MULTISUBDIR)" \
69 "MULTIOSDIR=$(MULTIOSDIR)" \
70 "MULTIBUILDTOP=$(MULTIBUILDTOP)" \
71 "MULTIFLAGS=$(MULTIFLAGS)" \
72 "PICFLAG=$(PICFLAG)" \
73 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
74 "SHELL=$(SHELL)" \
75 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
76 "exec_prefix=$(exec_prefix)" \
77 "infodir=$(infodir)" \
78 "libdir=$(libdir)" \
79 "includedir=$(includedir)" \
80 "prefix=$(prefix)" \
81 "tooldir=$(tooldir)" \
82 "AR=$(AR)" \
83 "AS=$(AS)" \
84 "LD=$(LD)" \
85 "RANLIB=$(RANLIB)" \
86 "NM=$(NM)" \
87 "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
88 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
89 "DESTDIR=$(DESTDIR)" \
90 "WERROR=$(WERROR)" \
91 "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)"
92
93 # Subdir rules rely on $(FLAGS_TO_PASS)
94 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
95
96 if BUILD_PIMLIB
97 toolexeclib_LTLIBRARIES = libm2pim.la
98
99 M2MODS = ASCII.mod IO.mod \
100 Args.mod M2RTS.mod \
101 M2Dependent.mod \
102 Assertion.mod NumberIO.mod \
103 Break.mod SYSTEM.mod \
104 CmdArgs.mod Scan.mod \
105 StrCase.mod FIO.mod \
106 StrIO.mod StrLib.mod \
107 TimeString.mod Environment.mod \
108 FpuIO.mod Debug.mod \
109 SysStorage.mod Storage.mod \
110 StdIO.mod SEnvironment.mod \
111 DynamicStrings.mod SFIO.mod \
112 SArgs.mod SCmdArgs.mod \
113 PushBackInput.mod \
114 StringConvert.mod FormatStrings.mod \
115 Builtins.mod MathLib0.mod \
116 M2EXCEPTION.mod RTExceptions.mod \
117 SMathLib0.mod RTint.mod \
118 Indexing.mod \
119 LMathLib0.mod LegacyReal.mod \
120 MemUtils.mod gdbif.mod \
121 GetOpt.mod OptLib.mod \
122 ARRAYOFCHAR.mod \
123 CHAR.mod \
124 StringFileSysOp.mod \
125 String.mod \
126 FileSysOp.mod
127
128 # COROUTINES.mod has been removed as it is implemented in ../libm2iso.
129
130 M2DEFS = Args.def ASCII.def \
131 Assertion.def Break.def \
132 Builtins.def cbuiltin.def \
133 CmdArgs.def CFileSysOp.def \
134 COROUTINES.def \
135 cxxabi.def Debug.def \
136 dtoa.def DynamicStrings.def \
137 Environment.def errno.def \
138 FIO.def FormatStrings.def \
139 FpuIO.def gdbif.def \
140 Indexing.def \
141 IO.def ldtoa.def \
142 LegacyReal.def libc.def \
143 libm.def LMathLib0.def \
144 M2Dependent.def \
145 M2EXCEPTION.def \
146 M2RTS.def \
147 MathLib0.def MemUtils.def \
148 NumberIO.def PushBackInput.def \
149 RTExceptions.def RTint.def \
150 SArgs.def SCmdArgs.def \
151 Scan.def \
152 sckt.def Selective.def \
153 SEnvironment.def SFIO.def \
154 SMathLib0.def StdIO.def \
155 Storage.def StrCase.def \
156 StringConvert.def StrIO.def \
157 StrLib.def SysExceptions.def \
158 SysStorage.def SYSTEM.def \
159 termios.def TimeString.def \
160 UnixArgs.def wrapc.def \
161 GetOpt.def OptLib.def \
162 cgetopt.def \
163 ARRAYOFCHAR.def \
164 CHAR.def \
165 StringFileSysOp.def \
166 String.def \
167 FileSysOp.def
168
169 libm2pim_la_SOURCES = $(M2MODS) \
170 UnixArgs.cc \
171 Selective.cc sckt.cc \
172 errno.cc dtoa.cc \
173 ldtoa.cc termios.cc \
174 SysExceptions.cc target.c \
175 wrapc.cc cgetopt.cc \
176 CFileSysOp.cc
177
178 libm2pimdir = libm2pim
179 libm2pim_la_DEPENDENCIES = SYSTEM.def $(addsuffix .lo, $(basename $(libm2pim_la_SOURCES)))
180 libm2pim_la_CFLAGS = \
181 -I. -I.. -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso \
182 -DBUILD_GM2_LIBS -I@srcdir@/../ -I@srcdir@/../libm2iso
183
184 libm2pim_la_M2FLAGS = \
185 -fm2-pathname=m2pim -I. -I$(GM2_SRC)/gm2-libs \
186 -fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
187 -fm2-g -g -Wcase-enum -Wreturn-type \
188 -fcase -fm2-prefix=m2pim
189
190 if TARGET_DARWIN
191 libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup
192 else
193 libm2pim_la_link_flags =
194 endif
195 if ENABLE_DARWIN_AT_RPATH
196 libm2pim_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
197 endif
198 libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) -lm
199 BUILT_SOURCES = SYSTEM.def
200 CLEANFILES = SYSTEM.def
201
202 M2LIBDIR = /m2/m2pim/
203
204 SYSTEM.def: Makefile
205 bash $(GM2_SRC)/tools-src/makeSystem -fpim \
206 $(GM2_SRC)/gm2-libs/SYSTEM.def \
207 $(GM2_SRC)/gm2-libs/SYSTEM.mod \
208 -I$(GM2_SRC)/gm2-libs \
209 "$(GM2_FOR_TARGET)" $@
210
211 .mod.lo: SYSTEM.def
212 $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
213 --mode=compile $(GM2_FOR_TARGET) \
214 -c $(CFLAGS_FOR_TARGET) $(LIBCFLAGS) $(libm2pim_la_M2FLAGS) $< -o $@
215
216 .cc.lo:
217 $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c -I$(srcdir) \
218 $(CXXFLAGS) $(LIBCFLAGS) $(libm2pim_la_CFLAGS) $< -o $@
219
220 install-data-local: force
221 mkdir -p $(DESTDIR)$(inst_libdir)/$(M2LIBDIR)
222 for i in $(M2DEFS) $(M2MODS) ; do \
223 if [ -f $$i ] ; then \
224 $(INSTALL_DATA) $$i '$(DESTDIR)$(inst_libdir)/$(M2LIBDIR)'; \
225 elif [ -f @srcdir@/../../gcc/m2/gm2-libs/$$i ] ; then \
226 $(INSTALL_DATA) @srcdir@/../../gcc/m2/gm2-libs/$$i '$(DESTDIR)$(inst_libdir)/$(M2LIBDIR)'; \
227 else \
228 echo "cannot find $$i" ; exit 1 ; \
229 fi ; \
230 chmod 644 $(DESTDIR)$(inst_libdir)/$(M2LIBDIR)$$i ; \
231 done
232
233 force:
234
235 endif