From patchwork Wed Oct 26 08:18:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 11149 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp135982wru; Wed, 26 Oct 2022 01:48:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4iKAigGHrkv7qGM9guwC5aEeWoe7OZDMgeVi4E0iMyCOJFrWaOHcu9LpN5CgjW76sejfqR X-Received: by 2002:a05:6402:35d6:b0:45d:a52f:2d30 with SMTP id z22-20020a05640235d600b0045da52f2d30mr38723605edc.4.1666774135578; Wed, 26 Oct 2022 01:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666774135; cv=none; d=google.com; s=arc-20160816; b=tLTUiFJpRhfWI2NFf8GSXBlZOjrkZ3uAydblpXf+Syd2EVR4oJyRQm94CF/dr2BQFA sIpN+wcOv6/EntB/L2PRvjNB+g3dox0rabWrMV1zYGheeDgRDT0i5xt8W99Slb93gt37 MWqepIXWGIr1g1JpkDQn0TBOpyihtZVE/yLvrKW6j4JLstNyGYupOk2CwUNUnZkLv6YK nnhXBjcigu2Z57Js0t3zDni5qFiQ2tX+u1I+ono9jFREgKvBd7z7Vqw5l9rhLViA4qvJ Dh90TUpeBp4FCqe95ZG1qLeN+jDs01vj64b3QcdHpU6eEwStOoTQeaeVkbGOcXdO4uCT DrJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:dmarc-filter :delivered-to; bh=epPw7A+UELiqt1MnH8rn0NJGjHIUdp1yALibEQ4x9vE=; b=LCOca2R/LtTJ/jcXaix8ze3pbxObKv0DRK8ixRAxqDsxRrmXzzezKjZn4FVolq5AJe wwZsI37j7EpkJtgJHWBXfUhu2B6xxd/6o752HVxclSFrFPmPShlDZ4RQfjdWNVHCjEn2 4hMIjnGMcITuEMccnWL9zzm35ajWWa+ZYuLO0QOpq3kl7pgcV7JfHnwxOe4InWPWT3F6 2A8Jl4rMa+YlceClTw/7npSB5QQPNTUJUHj1YiUWAnbZIQSWNjL78TBtalFyInf86ce6 44AP1nwICezEIRMCFzrzNhzqZFngRM70U945BUUKz5dBLNS+5sCf0s/G3aPUBOWdblcV Yq8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=B75CtQfd; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g8-20020a1709061e0800b0078849a014e9si4610446ejj.196.2022.10.26.01.48.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 01:48:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=B75CtQfd; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC9033986421 for ; Wed, 26 Oct 2022 08:36:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 37E463846440 for ; Wed, 26 Oct 2022 08:16:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37E463846440 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x433.google.com with SMTP id y16so14584810wrt.12 for ; Wed, 26 Oct 2022 01:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=epPw7A+UELiqt1MnH8rn0NJGjHIUdp1yALibEQ4x9vE=; b=B75CtQfdMPFtcxs9tz3Is3UgU8+IlKVVBNKYH8zQXVJw+boo0g8nyS0US08ybBEU6Y Ff/Cb7DJRjl8PqQ1wroUIw+jqB7QMre6F7Hro5scxP3F1ZoyCTnRtQpFp9+60BSr8wuZ xSN9eQcrOLu3GBYZUUF7Eaz8HBq8TCc05ZQuNjO2QenRj6uRBd/W7+2rkoqTXvyYhp4O 2SEAy9a2TZcZA7Tdxj4IPUyxLGx6SLO59mjrgNIsaffyi/gA4IqVYfb0CBW6bPRDC0b2 zvyTXOPHQgnI1+hjU75KB+3BXEW69QPSjc9Zh4BqE8VDqswNITFxrzllBJqczqGV4IEO C8pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=epPw7A+UELiqt1MnH8rn0NJGjHIUdp1yALibEQ4x9vE=; b=sshxMUeWuDZFpM0uRPTsSVLQaOuDe3/nRmvmyhlx1g1rLUD/OFd7lplUMBdUJ7yg1H LtBkDmMXhv0hhMJNBDm21B1gDadAqpZcbbpwLFHgRcaBn/aJSgE2/at405k3Ac7fqt+n UVXUj7NGI6fDw5kH896+zHKhlIDekhQDpjquTDWtmGbv14q1x4SUqgCE4WVXr6gsQbBL 9DYmyJGP7FsvaEGib6HmsfyJ8gfri+l5jfjpPT4ENpO0nEffpk3lvFeWDeTeWFf8tQ6W 6lXMv8H/BnWmJPo0Clo427r+j9lT/Bl2NELX7jnkpp09vzGKwC8W+/bBEOwZzXtNJi1S 584A== X-Gm-Message-State: ACrzQf0N05S0KCi7/F3yUmikfTR4BTECvkpQpDgItpvBP654xoFUt/Ad iQ5EghuYJMX/ySCHbYWvinzIgSjHNlU4WoF5VQ== X-Received: by 2002:a5d:59a3:0:b0:22e:4b62:7ceb with SMTP id p3-20020a5d59a3000000b0022e4b627cebmr28578831wrr.90.1666772168392; Wed, 26 Oct 2022 01:16:08 -0700 (PDT) Received: from platypus.lan ([2001:861:5e4c:3bb0:6424:328a:1734:3249]) by smtp.googlemail.com with ESMTPSA id q16-20020a05600c46d000b003c6f426467fsm1134310wmo.40.2022.10.26.01.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 01:16:07 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Subject: [PATCH Rust front-end v3 40/46] gccrs: Add GCC Rust front-end Make-lang.in Date: Wed, 26 Oct 2022 10:18:05 +0200 Message-Id: <20221026081811.602573-41-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221026081811.602573-1-arthur.cohen@embecosm.com> References: <20221026081811.602573-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Cc: gcc-rust@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747739356189942120?= X-GMAIL-MSGID: =?utf-8?q?1747739356189942120?= From: Philip Herron This is the Makefile for our front-end. --- gcc/rust/Make-lang.in | 399 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 gcc/rust/Make-lang.in diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in new file mode 100644 index 00000000000..a62e793a29d --- /dev/null +++ b/gcc/rust/Make-lang.in @@ -0,0 +1,399 @@ +# Make-lang.in -- Top level -*- makefile -*- fragment for GCC Rust frontend. + +# Copyright (C) 2009-2022 Free Software Foundation, Inc. + +# This file is part of GCC. + +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# This file provides the language dependent support in the main Makefile. + +#RUST_EXES = rust + +# Use strict warnings for this front end. +rust-warn = $(STRICT_WARN) + +# Installation name. Useful for cross compilers and used during install. +GCCRS_INSTALL_NAME := $(shell echo gccrs|sed '$(program_transform_name)') +GCCRS_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gccrs|sed '$(program_transform_name)') + +# Define the names for selecting rust in LANGUAGES. +rust: rust1$(exeext) + +# Tell GNU make to ignore files by these names if they exist. +.PHONY: rust + +# removed GRS_CFLAGS from here + +CFLAGS-rust/rustspec.o += $(DRIVER_DEFINES) + +# Create the compiler driver gccrs. +# A compiler driver is the program that interprets command argument and can be called from the command +# line - e.g. gcc or g++, and not cc1, which is the actual compiler + +# Create driver objects +GCCRS_D_OBJS = \ + $(GCC_OBJS) \ + rust/rustspec.o \ + $(END) + +gccrs$(exeext): $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) + +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ + $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ + $(EXTRA_GCC_LIBS) $(LIBS) + +# List of host object files used by the rust language - files for translation from the parse tree +# to GENERIC +# The compiler proper, not driver +GRS_OBJS = \ + rust/rust-lang.o \ + rust/rust-object-export.o \ + rust/rust-linemap.o \ + rust/rust-gcc-diagnostics.o \ + rust/rust-diagnostics.o \ + rust/rust-gcc.o \ + rust/rust-token.o \ + rust/rust-lex.o \ + rust/rust-cfg-parser.o \ + rust/rust-parse.o \ + rust/rust-ast-full-test.o \ + rust/rust-ast-dump.o \ + rust/rust-hir-dump.o \ + rust/rust-session-manager.o \ + rust/rust-compile.o \ + rust/rust-mangle.o \ + rust/rust-compile-resolve-path.o \ + rust/rust-macro-expand.o \ + rust/rust-attribute-visitor.o \ + rust/rust-macro-invoc-lexer.o \ + rust/rust-macro-substitute-ctx.o \ + rust/rust-macro-builtins.o \ + rust/rust-hir-full-test.o \ + rust/rust-hir-map.o \ + rust/rust-attributes.o \ + rust/rust-abi.o \ + rust/rust-ast-lower.o \ + rust/rust-ast-lower-base.o \ + rust/rust-ast-lower-pattern.o \ + rust/rust-ast-lower-item.o \ + rust/rust-name-resolver.o \ + rust/rust-ast-resolve.o \ + rust/rust-ast-resolve-base.o \ + rust/rust-ast-resolve-item.o \ + rust/rust-ast-resolve-pattern.o \ + rust/rust-ast-resolve-expr.o \ + rust/rust-ast-resolve-type.o \ + rust/rust-ast-resolve-path.o \ + rust/rust-ast-resolve-stmt.o \ + rust/rust-ast-resolve-struct-expr-field.o \ + rust/rust-hir-type-check.o \ + rust/rust-privacy-check.o \ + rust/rust-privacy-ctx.o \ + rust/rust-reachability.o \ + rust/rust-visibility-resolver.o \ + rust/rust-pub-restricted-visitor.o \ + rust/rust-privacy-reporter.o \ + rust/rust-tyty.o \ + rust/rust-tyty-call.o \ + rust/rust-tyctx.o \ + rust/rust-tyty-bounds.o \ + rust/rust-hir-type-check-util.o \ + rust/rust-hir-trait-resolve.o \ + rust/rust-hir-type-check-toplevel.o \ + rust/rust-hir-type-check-item.o \ + rust/rust-hir-type-check-type.o \ + rust/rust-hir-type-check-struct.o \ + rust/rust-hir-type-check-pattern.o \ + rust/rust-hir-type-check-expr.o \ + rust/rust-hir-type-check-stmt.o \ + rust/rust-hir-type-check-enumitem.o \ + rust/rust-hir-type-check-implitem.o \ + rust/rust-hir-dot-operator.o \ + rust/rust-coercion.o \ + rust/rust-casts.o \ + rust/rust-hir-type-check-base.o \ + rust/rust-autoderef.o \ + rust/rust-substitution-mapper.o \ + rust/rust-const-checker.o \ + rust/rust-lint-marklive.o \ + rust/rust-lint-unused-var.o \ + rust/rust-hir-type-check-path.o \ + rust/rust-unsafe-checker.o \ + rust/rust-compile-intrinsic.o \ + rust/rust-compile-pattern.o \ + rust/rust-compile-fnparam.o \ + rust/rust-base62.o \ + rust/rust-optional-test.o \ + rust/rust-compile-item.o \ + rust/rust-compile-implitem.o \ + rust/rust-compile-stmt.o \ + rust/rust-compile-expr.o \ + rust/rust-compile-type.o \ + rust/rust-compile-block.o \ + rust/rust-compile-struct-field-expr.o \ + rust/rust-constexpr.o \ + rust/rust-compile-base.o \ + rust/rust-tree.o \ + rust/rust-compile-context.o \ + rust/rust-export-metadata.o \ + rust/rust-imports.o \ + rust/rust-import-archive.o \ + rust/rust-extern-crate.o \ + $(END) +# removed object files from here + +# All language-specific object files for Rust. +RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS) + +rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o + +# The compiler itself is called rust1 (formerly grs1) +rust1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) + +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ + $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) + +# Build hooks. + +lang_checks += check-rust +lang_checks_parallelized += check-rust +check_rust_parallelize = 10 + +# Copies its dependencies into the source directory. This generally should be used for generated files +# such as Bison output files which are not version-controlled, but should be included in any release +# tarballs. This target will be executed during a bootstrap if ‘--enable-generated-files-in-srcdir’ +# was specified as a configure option. +rust.srcextra: + +rust.all.cross: gccrs$(exeext) + +# idk what this does but someone used it +rust.start.encap: gccrs$(exeext) +rust.rest.encap: + +# Build generated man pages for the front end from Texinfo manuals (see Man Page Generation), in the +# build directory. This target is only called if the necessary tools are available, but should ignore +# errors so as not to stop the build if errors occur; man pages are optional and the tools involved +# may be installed in a broken way. +rust.man: + +# Copies its dependencies into the source directory. These targets will be executed during a bootstrap +# if ‘--enable-generated-files-in-srcdir’ was specified as a configure option. +rust.srcman: + +# Clean hooks. + +rust.mostlyclean: +# cd $(srcdir)/rust; rm -f *.o y.tab.h y.tab.c lex.yy.c + +rust.clean: rust.mostlyclean + +# Builds an etags TAGS file in the language subdirectory in the source tree. +# TODO: add more directories if I add more +rust.tags: force + cd $(srcdir)/rust; \ + etags -o TAGS.sub *.y *.l *.cc *.h ast/*.h ast/*.cc lex/*.h lex/*.cc parse/*.h parse/*.cc; \ + etags --include TAGS.sub --include ../TAGS.sub + +# Build documentation hooks. + +# Build info documentation for the front end, in the build directory. This target is only called by +# ‘make bootstrap’ if a suitable version of makeinfo is available, so does not need to check for this, +# and should fail if an error occurs. +rust.info: + +rust.srcinfo: + +# Build DVI documentation for the front end, in the build directory. This should be done using +# $(TEXI2DVI), with appropriate -I arguments pointing to directories of included files. +rust.dvi: + +# Build PDF documentation for the front end, in the build directory. This should be done using +# $(TEXI2PDF), with appropriate -I arguments pointing to directories of included files. +rust.pdf: + +doc/rust.info: +doc/rust.dvi: +doc/rust.pdf: + +# Build HTML documentation for the front end, in the build directory. +rust.html: + +# Install hooks. + +# Install everything that is part of the front end, apart from the compiler executables listed in +# compilers in config-lang.in. +rust.install-common: installdirs +# -rm -f $(DESTDIR)$(bindir)/$(GCCRS_INSTALL_NAME)$(exeext) +# -rm -f $(DESTDIR)$(bindir)/$(GCCRS_TARGET_INSTALL_NAME)$(exeext) +# $(INSTALL_PROGRAM) gccrs$(exeext) $(DESTDIR)$(bindir)/$(GCCRS_INSTALL_NAME)$(exeext) +# if test -f $(DESTDIR)$(bindir)$(GCCRS_TARGET_INSTALL_NAME)$(exeext); then \ +# :; \ +# else \ +# cd $(DESTDIR)$(bindir) && \ +# $(LN) $(GCCRS_INSTALL_NAME)$(exeext) $(GCCRS_TARGET_INSTALL_NAME)$(exeext); \ +# fi + -rm -f $(DESTDIR)$(bindir)/$(GCCRS_INSTALL_NAME)$(exeext) + $(INSTALL_PROGRAM) gccrs$(exeext) $(DESTDIR)$(bindir)/$(GCCRS_INSTALL_NAME)$(exeext) + rm -f $(DESTDIR)$(bindir)/$(GCCRS_TARGET_INSTALL_NAME)$(exeext); \ + ( cd $(DESTDIR)$(bindir) && \ + $(LN) $(GCCRS_INSTALL_NAME)$(exeext) $(GCCRS_TARGET_INSTALL_NAME)$(exeext) ); \ + +# Install headers needed for plugins. +rust.install-plugin: + +# Uninstall files installed by installing the compiler. This is currently documented not to be +# supported, so the hook need not do anything. +rust.uninstall: +# -rm -rf $(DESTDIR)/$(bindir)/$(GCCRS_INSTALL_NAME)$(exeext) + -rm -f gccrs$(exeext) grs1$(exeext) + -rm -f $(RUST_ALL_OBJS) +# ^those two are a maybe + +# Enable selftests for the rust frontend +selftest-rust: s-selftest-rust + +RUST_SELFTEST_FLAGS = -xrs $(SELFTEST_FLAGS) +RUST_SELFTEST_DEPS = rust1$(exeext) $(SELFTEST_DEPS) + +# Run the rust selftests +s-selftest-rust: $(RUST_SELFTEST_DEPS) + $(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) + $(STAMP) $@ + +# Install info documentation for the front end, if it is present in the source directory. This target +# should have dependencies on info files that should be installed. +rust.install-info: + +rust.install-pdf: + +# Install man pages for the front end. This target should ignore errors. +rust.install-man: + +# Stage hooks: +# The toplevel makefile has already created stage?/rust at this point. +# Used for handling bootstrap + +rust.stage1: stage1-start + -mv rust/*$(objext) stage1/rust +rust.stage2: stage2-start + -mv rust/*$(objext) stage2/rust +rust.stage3: stage3-start + -mv rust/*$(objext) stage3/rust +rust.stage4: stage4-start + -mv rust/*$(objext) stage4/rust +rust.stageprofile: stageprofile-start + -mv rust/*$(objext) stageprofile/rust +rust.stagefeedback: stagefeedback-start + -mv rust/*$(objext) stagefeedback/rust + +CFLAGS-rust/rust-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \ + -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" + +# cross-folder includes - add new folders later +RUST_INCLUDES = -I $(srcdir)/rust \ + -I $(srcdir)/rust/lex \ + -I $(srcdir)/rust/parse \ + -I $(srcdir)/rust/ast \ + -I $(srcdir)/rust/analysis \ + -I $(srcdir)/rust/backend \ + -I $(srcdir)/rust/expand \ + -I $(srcdir)/rust/hir/tree \ + -I $(srcdir)/rust/hir \ + -I $(srcdir)/rust/resolve \ + -I $(srcdir)/rust/util \ + -I $(srcdir)/rust/typecheck \ + -I $(srcdir)/rust/checks/lints \ + -I $(srcdir)/rust/checks/errors \ + -I $(srcdir)/rust/checks/errors/privacy \ + -I $(srcdir)/rust/util \ + -I $(srcdir)/rust/metadata + +# add files that require cross-folder includes - currently rust-lang.o, rust-lex.o +CFLAGS-rust/rust-lang.o += $(RUST_INCLUDES) +CFLAGS-rust/rust-lex.o += $(RUST_INCLUDES) +CFLAGS-rust/rust-parse.o += $(RUST_INCLUDES) +CFLAGS-rust/rust-session-manager.o += $(RUST_INCLUDES) + +RUST_CXXFLAGS = $(CXXFLAGS) + +# build all rust/lex files in rust folder, add cross-folder includes +rust/%.o: rust/lex/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build all rust/parse files in rust folder, add cross-folder includes +rust/%.o: rust/parse/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/ast files in rust folder +rust/%.o: rust/ast/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/backend files in rust folder +rust/%.o: rust/backend/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/expand files in rust folder +rust/%.o: rust/expand/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/util files in rust folder +rust/%.o: rust/util/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/hir files in rust folder +rust/%.o: rust/hir/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/hir/tree files in rust folder +rust/%.o: rust/hir/tree/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/resolve files in rust folder +rust/%.o: rust/resolve/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/typecheck files in rust folder +rust/%.o: rust/typecheck/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/checks/lints files in rust folder +rust/%.o: rust/checks/lints/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/checks/errors files in rust folder +rust/%.o: rust/checks/errors/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build privacy pass files in rust folder +rust/%.o: rust/checks/errors/privacy/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build rust/metadata files in rust folder +rust/%.o: rust/metadata/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE)