[libc-test] include $(B)/config.mak instead of config.mak

Submitted by Fangrui Song on Aug. 14, 2019, 2:52 a.m.

Details

Message ID 20190814025229.aydkh3glw5syo6ue@gmail.com
State New
Series "include $(B)/config.mak instead of config.mak"
Headers show

Commit Message

Fangrui Song Aug. 14, 2019, 2:52 a.m.
This makes it easy to test different configurations, e.g.

# cd libc-test
mkdir -p powerpc64le
# edit powerpc64le/config.mak
make B=powerpc64le

Patch hide | download patch | download mbox

From 8e39c68bf088b9934e6632d02c129ccc85fcbc32 Mon Sep 17 00:00:00 2001
From: Fangrui Song <i@maskray.me>
Date: Wed, 14 Aug 2019 02:47:22 +0000
Subject: [PATCH] include $(B)/config.mak instead of config.mak

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index e786499..3e15d33 100644
--- a/Makefile
+++ b/Makefile
@@ -34,9 +34,9 @@  all:
 %: s.%
 %: SCCS/s.%
 
-config.mak:
+$(B)/config.mak:
 	cp config.mak.def $@
--include config.mak
+-include $(B)/config.mak
 
 define default_template
 $(1).BINS_TEMPL:=bin.exe bin-static.exe
-- 
2.22.0


Comments

Szabolcs Nagy Aug. 22, 2019, 7:39 p.m.
* Fangrui Song <i@maskray.me> [2019-08-14 02:52:29 +0000]:
> --- a/Makefile
> +++ b/Makefile
> @@ -34,9 +34,9 @@ all:
>  %: s.%
>  %: SCCS/s.%
>  
> -config.mak:
> +$(B)/config.mak:
>  	cp config.mak.def $@
> --include config.mak
> +-include $(B)/config.mak
>  

this can break existing usage
by default B=src not .

for now you can include $(B)/config.mak
into your top level config.mak