]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgm2/libm2pim/Makefile.am
Merge modula-2 front end onto gcc.
[thirdparty/gcc.git] / libgm2 / libm2pim / Makefile.am
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 .. -I ../config
21
22 VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs
23
24 # Multilib support.
25 MAKEOVERRIDES=
26
27 version := $(shell $(CC) -dumpversion)
28
29 # Directory in which the compiler finds libraries etc.
30 libsubdir = $(libdir)/gcc/$(target_alias)/$(version)
31 # Used to install the shared libgcc.
32 slibdir = @slibdir@
33
34 toolexeclibdir=@toolexeclibdir@
35 toolexecdir=@toolexecdir@
36 GM2_FOR_TARGET=@GM2_FOR_TARGET@
37
38 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
39 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
40
41 MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
42 inst_libdir = $(libsubdir)$(MULTISUBDIR)
43 inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
44
45
46 # Work around what appears to be a GNU make bug handling MAKEFLAGS
47 # values defined in terms of make variables, as is the case for CC and
48 # friends when we are called from the top level Makefile.
49 AM_MAKEFLAGS = \
50 "GCC_DIR=$(GCC_DIR)" \
51 "GM2_SRC=$(GM2_SRC)" \
52 "AR_FLAGS=$(AR_FLAGS)" \
53 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
54 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
55 "GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
56 "CFLAGS=$(CFLAGS)" \
57 "CXXFLAGS=$(CXXFLAGS)" \
58 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
59 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
60 "INSTALL=$(INSTALL)" \
61 "INSTALL_DATA=$(INSTALL_DATA)" \
62 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
63 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
64 "LDFLAGS=$(LDFLAGS)" \
65 "LIBCFLAGS=$(LIBCFLAGS)" \
66 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
67 "MAKE=$(MAKE)" \
68 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
69 "MULTISUBDIR=$(MULTISUBDIR)" \
70 "MULTIOSDIR=$(MULTIOSDIR)" \
71 "MULTIBUILDTOP=$(MULTIBUILDTOP)" \
72 "MULTIFLAGS=$(MULTIFLAGS)" \
73 "PICFLAG=$(PICFLAG)" \
74 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
75 "SHELL=$(SHELL)" \
76 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
77 "exec_prefix=$(exec_prefix)" \
78 "infodir=$(infodir)" \
79 "libdir=$(libdir)" \
80 "includedir=$(includedir)" \
81 "prefix=$(prefix)" \
82 "tooldir=$(tooldir)" \
83 "AR=$(AR)" \
84 "AS=$(AS)" \
85 "LD=$(LD)" \
86 "RANLIB=$(RANLIB)" \
87 "NM=$(NM)" \
88 "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
89 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
90 "DESTDIR=$(DESTDIR)" \
91 "WERROR=$(WERROR)" \
92 "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)"
93
94 # Subdir rules rely on $(FLAGS_TO_PASS)
95 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
96
97 if BUILD_PIMLIB
98 toolexeclib_LTLIBRARIES = libm2pim.la
99
100 M2MODS = ASCII.mod IO.mod \
101 Args.mod M2RTS.mod \
102 M2Dependent.mod \
103 Assertion.mod NumberIO.mod \
104 Break.mod SYSTEM.mod \
105 CmdArgs.mod Scan.mod \
106 StrCase.mod FIO.mod \
107 StrIO.mod StrLib.mod \
108 TimeString.mod Environment.mod \
109 FpuIO.mod Debug.mod \
110 SysStorage.mod Storage.mod \
111 StdIO.mod SEnvironment.mod \
112 DynamicStrings.mod SFIO.mod \
113 SArgs.mod SCmdArgs.mod \
114 PushBackInput.mod \
115 StringConvert.mod FormatStrings.mod \
116 Builtins.mod MathLib0.mod \
117 M2EXCEPTION.mod RTExceptions.mod \
118 SMathLib0.mod RTint.mod \
119 Indexing.mod \
120 LMathLib0.mod LegacyReal.mod \
121 MemUtils.mod gdbif.mod \
122 GetOpt.mod OptLib.mod
123
124 # COROUTINES.mod has been removed as it is implemented in ../libm2iso.
125
126 M2DEFS = Args.def ASCII.def \
127 Assertion.def Break.def \
128 Builtins.def cbuiltin.def \
129 CmdArgs.def COROUTINES.def \
130 cxxabi.def Debug.def \
131 dtoa.def DynamicStrings.def \
132 Environment.def errno.def \
133 FIO.def FormatStrings.def \
134 FpuIO.def gdbif.def \
135 Indexing.def \
136 IO.def ldtoa.def \
137 LegacyReal.def libc.def \
138 libm.def LMathLib0.def \
139 M2Dependent.def \
140 M2EXCEPTION.def M2LINK.def \
141 M2RTS.def \
142 MathLib0.def MemUtils.def \
143 NumberIO.def PushBackInput.def \
144 RTExceptions.def RTint.def \
145 SArgs.def SCmdArgs.def \
146 Scan.def \
147 sckt.def Selective.def \
148 SEnvironment.def SFIO.def \
149 SMathLib0.def StdIO.def \
150 Storage.def StrCase.def \
151 StringConvert.def StrIO.def \
152 StrLib.def SysExceptions.def \
153 SysStorage.def SYSTEM.def \
154 termios.def TimeString.def \
155 UnixArgs.def wrapc.def \
156 GetOpt.def OptLib.def \
157 cgetopt.def
158
159 libm2pim_la_SOURCES = $(M2MODS) \
160 UnixArgs.cc \
161 Selective.cc sckt.cc \
162 errno.cc dtoa.cc \
163 ldtoa.cc termios.cc \
164 SysExceptions.cc target.c \
165 wrapc.c cgetopt.cc
166
167 libm2pimdir = libm2pim
168 libm2pim_la_DEPENDENCIES = SYSTEM.def $(addsuffix .lo, $(basename $(libm2pim_la_SOURCES)))
169 libm2pim_la_CFLAGS = -I. -I.. -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso -DBUILD_GM2_LIBS -I@srcdir@/../ -I@srcdir@/../libm2iso
170 libm2pim_la_M2FLAGS = -I. -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso -fm2-g -g
171 libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION)
172 BUILT_SOURCES = SYSTEM.def
173 CLEANFILES = SYSTEM.def
174
175 M2LIBDIR = /m2/m2pim/
176
177 SYSTEM.def: Makefile
178 bash $(GM2_SRC)/tools-src/makeSystem -fpim \
179 $(GM2_SRC)/gm2-libs/SYSTEM.def \
180 $(GM2_SRC)/gm2-libs/SYSTEM.mod \
181 -I$(GM2_SRC)/gm2-libs \
182 "$(GM2_FOR_TARGET)" $@
183
184 .mod.lo: SYSTEM.def
185 $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(GM2_FOR_TARGET) -c $(CFLAGS_FOR_TARGET) $(LIBCFLAGS) $(libm2pim_la_M2FLAGS) $< -o $@
186
187 .cc.lo:
188 $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(LIBCFLAGS) $(libm2pim_la_CFLAGS) $< -o $@
189
190 install-data-local: force
191 mkdir -p $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
192 $(INSTALL_DATA) .libs/libm2pim.la $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
193 chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2pim.la
194 $(INSTALL_DATA) .libs/libm2pim.a $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
195 $(RANLIB) $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2pim.a
196 for i in $(M2DEFS) $(M2MODS) ; do \
197 if [ -f $$i ] ; then \
198 $(INSTALL_DATA) $$i '$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)'; \
199 elif [ -f @srcdir@/../../gcc/m2/gm2-libs/$$i ] ; then \
200 $(INSTALL_DATA) @srcdir@/../../gcc/m2/gm2-libs/$$i '$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)'; \
201 else \
202 echo "cannot find $$i" ; exit 1 ; \
203 fi ; \
204 chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)$$i ; \
205 done
206
207 force:
208
209 endif