tree-optimization/112618 - unused .MASK_CALL
[official-gcc.git] / libgm2 / libm2cor / Makefile.am
bloba515bd2c88642129c0dd669e42132cee1afdedff
1 # Makefile for libm2cor.
2 #   Copyright 2013-2022  Free Software Foundation, Inc.
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.
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.
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/>.
18 SUFFIXES = .c .cc .mod .def .o .obj .lo .a .la
20 ACLOCAL_AMFLAGS = -I .. -I ../config
22 VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs-coroutines
24 # Multilib support.
25 MAKEOVERRIDES=
27 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
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@
34 toolexeclibdir=@toolexeclibdir@
35 toolexecdir=@toolexecdir@
36 GM2_FOR_TARGET=@GM2_FOR_TARGET@
38 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
39 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
41 MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
42 inst_libdir = $(libsubdir)$(MULTISUBDIR)
43 inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
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         "CFLAGS_LONGDOUBLE=$(CFLAGS_LONGDOUBLE)" \
61         "INSTALL=$(INSTALL)" \
62         "INSTALL_DATA=$(INSTALL_DATA)" \
63         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
64         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
65         "LDFLAGS=$(LDFLAGS)" \
66         "LIBCFLAGS=$(LIBCFLAGS)" \
67         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
68         "MAKE=$(MAKE)" \
69         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
70         "MULTIBUILDTOP=$(MULTIBUILDTOP)" \
71         "MULTISUBDIR=$(MULTISUBDIR)" \
72         "MULTIOSDIR=$(MULTIOSDIR)" \
73         "MULTIFLAGS=$(MULTIFLAGS)" \
74         "PICFLAG=$(PICFLAG)" \
75         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
76         "SHELL=$(SHELL)" \
77         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
78         "exec_prefix=$(exec_prefix)" \
79         "infodir=$(infodir)" \
80         "libdir=$(libdir)" \
81         "includedir=$(includedir)" \
82         "prefix=$(prefix)" \
83         "tooldir=$(tooldir)" \
84         "gxx_include_dir=$(gxx_include_dir)" \
85         "AR=$(AR)" \
86         "AS=$(AS)" \
87         "LD=$(LD)" \
88         "RANLIB=$(RANLIB)" \
89         "NM=$(NM)" \
90         "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
91         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
92         "DESTDIR=$(DESTDIR)" \
93         "WERROR=$(WERROR)" \
94         "TARGET_LONGDOUBLE_ABI=$(TARGET_LONGDOUBLE_ABI)" \
95         "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)"
97 # Subdir rules rely on $(FLAGS_TO_PASS)
98 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
101 if BUILD_CORLIB
102 M2DEFS = Executive.def \
103          KeyBoardLEDs.def  SYSTEM.def \
104          TimerHandler.def
106 M2MODS = Executive.mod \
107          SYSTEM.mod  TimerHandler.mod
109 toolexeclib_LTLIBRARIES = libm2cor.la
111 libm2cor_la_SOURCES = $(M2MODS) KeyBoardLEDs.cc
113 nodist_EXTRA_libm2cor_la_SOURCES = dummy.c  ## forces automake to generate the LINK definition
115 libm2cordir = libm2cor
116 libm2cor_la_DEPENDENCIES = SYSTEM.def $(addsuffix .lo, $(basename $(libm2cor_la_SOURCES)))
117 libm2cor_la_CFLAGS = \
118     -I. -I.. -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso \
119     -DBUILD_GM2_LIBS -I@srcdir@/../  -I@srcdir@/../libm2iso \
120     $(TARGET_LONGDOUBLE_ABI)
121 libm2cor_la_M2FLAGS = \
122     -fm2-pathname=m2cor -I. -I$(GM2_SRC)/gm2-libs-coroutines \
123     -fm2-pathname=m2pim -I$(GM2_SRC)/gm2-libs \
124     -fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
125     -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2cor \
126     $(TARGET_LONGDOUBLE_ABI)
127 if TARGET_DARWIN
128 libm2cor_la_link_flags = -Wl,-undefined,dynamic_lookup
129 else
130 libm2cor_la_link_flags =
131 endif
132 if ENABLE_DARWIN_AT_RPATH
133 libm2cor_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
134 endif
136 libm2cor_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2cor_la_link_flags)
137 BUILT_SOURCES = SYSTEM.def
138 CLEANFILES = SYSTEM.def
140 M2LIBDIR = /m2/m2cor/
142 SYSTEM.def: Makefile
143         bash $(GM2_SRC)/tools-src/makeSystem -fpim \
144              $(GM2_SRC)/gm2-libs-coroutines/SYSTEM.def \
145              $(GM2_SRC)/gm2-libs-coroutines/SYSTEM.mod \
146              -I$(GM2_SRC)/gm2-libs-coroutines -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso \
147              "$(GM2_FOR_TARGET)" $@
149 .mod.lo:
150         $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
151                    --mode=compile $(GM2_FOR_TARGET) \
152                    -c $(CFLAGS_FOR_TARGET) $(LIBCFLAGS) $(libm2cor_la_M2FLAGS) $< -o $@
154 .cc.lo:
155         $(LIBTOOL) --tag=CXX --mode=compile $(CXX) \
156                    -c -I$(srcdir) $(CXXFLAGS) $(LIBCFLAGS) $(libm2cor_la_CFLAGS) $< -o $@
158 install-data-local: force
159         mkdir -p $(DESTDIR)$(inst_libdir)/$(M2LIBDIR)
160         for i in $(M2DEFS) $(M2MODS) ; do \
161            if [ -f $$i ] ; then \
162               $(INSTALL_DATA) $$i '$(DESTDIR)$(inst_libdir)/$(M2LIBDIR)'; \
163            elif [ -f @srcdir@/../../gcc/m2/gm2-libs-coroutines/$$i ] ; then \
164               $(INSTALL_DATA) @srcdir@/../../gcc/m2/gm2-libs-coroutines/$$i '$(DESTDIR)$(inst_libdir)/$(M2LIBDIR)'; \
165            else \
166               echo "cannot find $$i" ; exit 1 ; \
167            fi ; \
168            chmod 644 $(DESTDIR)$(inst_libdir)/$(M2LIBDIR)$$i ; \
169         done
171 force:
173 endif