]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcc1/Makefile.am
c++: build_extra_args recapturing local specs [PR114303]
[thirdparty/gcc.git] / libcc1 / Makefile.am
CommitLineData
a945c346 1## Copyright (C) 2014-2024 Free Software Foundation, Inc.
ddc8de03
PM
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
19ACLOCAL_AMFLAGS = -I .. -I ../config
f8a7e154 20gcc_build_dir = ../gcc
ddc8de03 21AM_CPPFLAGS = -I $(srcdir)/../include -I $(srcdir)/../libgcc \
06248232
TT
22 -I $(gcc_build_dir) -I$(srcdir)/../gcc $($@_CPPFLAGS) $(GMPINC) \
23 -I $(srcdir)/../gcc/c-family -I $(srcdir)/../libcpp/include
24CPPFLAGS_FOR_C = -I $(srcdir)/../gcc/c
25CPPFLAGS_FOR_CXX = -I $(srcdir)/../gcc/cp
af3bef0e 26AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS)
1352bc88
IS
27if DARWIN_DYNAMIC_LOOKUP
28AM_CXXFLAGS += -Wl,-undefined,dynamic_lookup
29endif
b240450b 30override CXXFLAGS := $(subst -mdynamic-no-pic,-fPIC,$(CXXFLAGS))
56f274b2
JJ
31override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
32override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
33# Can be simplified when libiberty becomes a normal convenience library.
34libiberty_normal = ../libiberty/libiberty.a
35libiberty_noasan = ../libiberty/noasan/libiberty.a
36libiberty_pic = ../libiberty/pic/libiberty.a
37Wc=-Wc,
38libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
39 $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
40 $(Wc)$(libiberty_normal)))
41libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
ddc8de03
PM
42
43plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
44cc1libdir = $(libdir)/$(libsuffix)
45
46if ENABLE_PLUGIN
8db29d88 47plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
ddc8de03
PM
48cc1lib_LTLIBRARIES = libcc1.la
49endif
50
ddc8de03
PM
51shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
52 marshall.cc marshall.hh rpc.hh status.hh
53
8db29d88
AO
54marshall_c_source = marshall-c.hh
55marshall_cxx_source = marshall-cp.hh
56
ddc8de03 57libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
06248232
TT
58libcc1plugin_la_SOURCES = libcc1plugin.cc context.cc context.hh \
59 $(shared_source) $(marshall_c_source)
8db29d88 60libcc1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_C)
ddc8de03 61libcc1plugin_la_LIBADD = $(libiberty)
56f274b2
JJ
62libcc1plugin_la_DEPENDENCIES = $(libiberty_dep)
63libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
64 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
65 $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
ddc8de03 66
8db29d88 67libcp1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcp1plugin.sym
06248232
TT
68libcp1plugin_la_SOURCES = libcp1plugin.cc context.cc context.hh \
69 $(shared_source) $(marshall_cxx_source)
8db29d88
AO
70libcp1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_CXX)
71libcp1plugin_la_LIBADD = $(libiberty)
72libcp1plugin_la_DEPENDENCIES = $(libiberty_dep)
73libcp1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
74 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
75 $(CXXFLAGS) $(libcp1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
76
56f274b2 77LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
ddc8de03 78libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
8db29d88 79libcc1_la_SOURCES = findcomp.cc libcc1.cc libcp1.cc \
1d9c9726 80 compiler.cc compiler.hh names.cc names.hh $(shared_source) \
8db29d88 81 $(marshall_c_source) $(marshall_cxx_source)
ddc8de03 82libcc1_la_LIBADD = $(libiberty)
56f274b2
JJ
83libcc1_la_DEPENDENCIES = $(libiberty_dep)
84libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
85 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
86 $(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@