| 1 |
## Copyright (C) 2014-2025 Free Software Foundation, Inc. |
| 2 |
|
| 3 |
## This file is part of GCC. |
| 4 |
|
| 5 |
## GCC is free software; you can redistribute it and/or modify it under |
| 6 |
## the terms of the GNU General Public License as published by the Free |
| 7 |
## Software Foundation; either version 3, or (at your option) any later |
| 8 |
## version. |
| 9 |
|
| 10 |
## GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 11 |
## WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 13 |
## for more details. |
| 14 |
|
| 15 |
## You should have received a copy of the GNU General Public License |
| 16 |
## along with GCC; see the file COPYING3. If not see |
| 17 |
## <http://www.gnu.org/licenses/>. |
| 18 |
|
| 19 |
ACLOCAL_AMFLAGS = -I .. -I ../config |
| 20 |
gcc_build_dir = ../gcc |
| 21 |
AM_CPPFLAGS = -I $(srcdir)/../include -I $(srcdir)/../libgcc \ |
| 22 |
-I $(gcc_build_dir) -I$(srcdir)/../gcc $($@_CPPFLAGS) $(GMPINC) \ |
| 23 |
-I $(srcdir)/../gcc/c-family -I $(srcdir)/../libcpp/include |
| 24 |
CPPFLAGS_FOR_C = -I $(srcdir)/../gcc/c |
| 25 |
CPPFLAGS_FOR_CXX = -I $(srcdir)/../gcc/cp |
| 26 |
AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS) |
| 27 |
if DARWIN_DYNAMIC_LOOKUP |
| 28 |
AM_CXXFLAGS += -Wl,-undefined,dynamic_lookup |
| 29 |
endif |
| 30 |
override CXXFLAGS := $(subst -mdynamic-no-pic,-fPIC,$(CXXFLAGS)) |
| 31 |
override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS)) |
| 32 |
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS)) |
| 33 |
# Can be simplified when libiberty becomes a normal convenience library. |
| 34 |
libiberty_normal = ../libiberty/libiberty.a |
| 35 |
libiberty_noasan = ../libiberty/noasan/libiberty.a |
| 36 |
libiberty_pic = ../libiberty/pic/libiberty.a |
| 37 |
Wc=-Wc, |
| 38 |
libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ |
| 39 |
$(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \ |
| 40 |
$(Wc)$(libiberty_normal))) |
| 41 |
libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty)) |
| 42 |
|
| 43 |
plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin |
| 44 |
cc1libdir = $(libdir)/$(libsuffix) |
| 45 |
|
| 46 |
if ENABLE_PLUGIN |
| 47 |
plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la |
| 48 |
cc1lib_LTLIBRARIES = libcc1.la |
| 49 |
endif |
| 50 |
|
| 51 |
shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \ |
| 52 |
marshall.cc marshall.hh rpc.hh status.hh |
| 53 |
|
| 54 |
marshall_cxx_source = marshall-cp.hh |
| 55 |
|
| 56 |
libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym |
| 57 |
libcc1plugin_la_SOURCES = libcc1plugin.cc context.cc context.hh \ |
| 58 |
$(shared_source) |
| 59 |
libcc1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_C) |
| 60 |
libcc1plugin_la_LIBADD = $(libiberty) |
| 61 |
libcc1plugin_la_DEPENDENCIES = $(libiberty_dep) |
| 62 |
libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ |
| 63 |
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ |
| 64 |
$(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@ |
| 65 |
|
| 66 |
libcp1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcp1plugin.sym |
| 67 |
libcp1plugin_la_SOURCES = libcp1plugin.cc context.cc context.hh \ |
| 68 |
$(shared_source) $(marshall_cxx_source) |
| 69 |
libcp1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_CXX) |
| 70 |
libcp1plugin_la_LIBADD = $(libiberty) |
| 71 |
libcp1plugin_la_DEPENDENCIES = $(libiberty_dep) |
| 72 |
libcp1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ |
| 73 |
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ |
| 74 |
$(CXXFLAGS) $(libcp1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@ |
| 75 |
|
| 76 |
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) |
| 77 |
libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym |
| 78 |
libcc1_la_SOURCES = findcomp.cc libcc1.cc libcp1.cc \ |
| 79 |
compiler.cc compiler.hh names.cc names.hh $(shared_source) \ |
| 80 |
$(marshall_cxx_source) |
| 81 |
libcc1_la_LIBADD = $(libiberty) |
| 82 |
libcc1_la_DEPENDENCIES = $(libiberty_dep) |
| 83 |
libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ |
| 84 |
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ |
| 85 |
$(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@ |