From eb3eaa38913933e3fcee9e3017ac1fca72411277 Mon Sep 17 00:00:00 2001 From: gaoyang3513 Date: Sun, 29 Oct 2023 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=20export=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=8F=98=E9=87=8F=E7=9A=84=E5=89=AF=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E5=AD=90makefile=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=8A=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 11 +++++------ dir1/Makefile | 6 ++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b53e7e6..516a9ba 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ +var_a = a -makedir := $(abspath $(lastword $(MAKEFILE_LIST))) -$(warning makedir1=$(makedir)) - -include dir1/Makefile -makedir := $(abspath $(lastword $(MAKEFILE_LIST))) -$(warning makedir3=$(makedir)) +export var_a +all: + make -C dir1 + echo "Get var_a=$(var_a)" diff --git a/dir1/Makefile b/dir1/Makefile index 0da385b..63c16f1 100644 --- a/dir1/Makefile +++ b/dir1/Makefile @@ -1,6 +1,8 @@ -makedir := $(abspath $(lastword $(MAKEFILE_LIST))) -$(warning makedir2=$(makedir)) +$(warning var_a=$(var_a)) +var_a = b +all: + echo "set var_a=b"