1 ## Copyright (C) 2014-2017 Free Software Foundation, Inc.
3 ## This file is part of GCC.
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
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
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/>.
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 \
23 -I $(srcdir)/../gcc/c -I $(srcdir)/../gcc/c-family \
24 -I $(srcdir)/../libcpp/include $(GMPINC)
25 AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility)
26 override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
27 override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
28 # Can be simplified when libiberty becomes a normal convenience library.
29 libiberty_normal = ../libiberty/libiberty.a
30 libiberty_noasan = ../libiberty/noasan/libiberty.a
31 libiberty_pic = ../libiberty/pic/libiberty.a
33 libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
34 $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
35 $(Wc)$(libiberty_normal)))
36 libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
38 plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
39 cc1libdir = $(libdir)/$(libsuffix)
42 plugin_LTLIBRARIES = libcc1plugin.la
43 cc1lib_LTLIBRARIES = libcc1.la
46 BUILT_SOURCES = compiler-name.h
47 MOSTLYCLEANFILES = compiler-name.h
49 # Put this in a header so we don't run sed for each compilation. This
50 # is also simpler to debug as one can easily see the constant.
51 compiler-name.h: Makefile
52 echo "#define COMPILER_NAME \"`echo gcc | sed '$(transform)'`\"" > $@
55 shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
56 marshall.cc marshall.hh rpc.hh status.hh
58 libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
59 libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
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 $@
66 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
67 libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
68 libcc1_la_SOURCES = findcomp.cc libcc1.cc names.cc names.hh $(shared_source)
69 libcc1_la_LIBADD = $(libiberty)
70 libcc1_la_DEPENDENCIES = $(libiberty_dep)
71 libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
72 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
73 $(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@