commit 492999f408b8edd748c714526838c8eed7430069
parent 27878b67282a944f15a9270d23621ff09b44839a
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date: Sun, 3 Jan 2021 10:39:56 +0100
all: add a central 'build.ninja' file
Diffstat:
6 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/btl.ninja b/btl.ninja
@@ -1,13 +0,0 @@
-PROJECT = btl
-BUILD = build
-ROOT = ./
-
-CXXFLAGS = $$CXXFLAGS -fcolor-diagnostics -DFILE_PTR=FILE*
-
-include conf.ninja
-
-build $DST/optparser.cpp.o: cxx $SRC/optparser.cpp
-build $DST/string.cpp.o: cxx $SRC/string.cpp
-build $DST/utils.cpp.o: cxx $SRC/utils.cpp
-
-build $DST/../btl.a: ar $DST/optparser.cpp.o $DST/string.cpp.o $DST/utils.cpp.o
diff --git a/btl/btl.ninja b/btl/btl.ninja
@@ -0,0 +1,14 @@
+PROJECT = btl
+BUILD = build
+ROOT = ./
+
+CXXFLAGS = $$CXXFLAGS -fcolor-diagnostics -DFILE_PTR=FILE*
+
+SRC = ./$ROOT/$PROJECT/src
+DST = ./$ROOT/$BUILD/$PROJECT/src
+
+build $DST/optparser.cpp.o: cxx $SRC/optparser.cpp
+build $DST/string.cpp.o: cxx $SRC/string.cpp
+build $DST/utils.cpp.o: cxx $SRC/utils.cpp
+
+build $DST/../btl.a: ar $DST/optparser.cpp.o $DST/string.cpp.o $DST/utils.cpp.o
diff --git a/build.ninja b/build.ninja
@@ -0,0 +1,4 @@
+include conf.ninja
+
+subninja btl/btl.ninja
+subninja lmerge/lmerge.ninja
diff --git a/conf.ninja b/conf.ninja
@@ -7,9 +7,6 @@ CC = $$CC
LD = $$CXX
AR = ar
-SRC = ./$ROOT/$PROJECT/src
-DST = ./$ROOT/$BUILD/$PROJECT/src
-
rule cc
description = compiling $in toward $out
depfile = $out.d
diff --git a/lmerge.ninja b/lmerge.ninja
@@ -1,15 +0,0 @@
-PROJECT = lmerge
-BUILD = build
-ROOT = ./
-
-CXXFLAGS = $$CXXFLAGS -fcolor-diagnostics -fno-rtti -fno-exceptions
-
-include conf.ninja
-
-subninja btl.ninja
-BTL_LIB = ./$ROOT/$BUILD/btl/
-BTL_INC = ./$ROOT/btl/src/
-CXXFLAGS = $CXXFLAGS -I$BTL_INC -DFILE_PTR=FILE*
-
-build $DST/lmerge.cpp.o: cxx $SRC/lmerge.cpp
-build $DST/../lmerge: ld $DST/lmerge.cpp.o $BTL_LIB/btl.a
diff --git a/lmerge/lmerge.ninja b/lmerge/lmerge.ninja
@@ -0,0 +1,15 @@
+PROJECT = lmerge
+BUILD = build
+ROOT = ./
+
+CXXFLAGS = $$CXXFLAGS -fcolor-diagnostics -fno-rtti -fno-exceptions
+
+SRC = ./$ROOT/$PROJECT/src
+DST = ./$ROOT/$BUILD/$PROJECT/src
+
+BTL_LIB = ./$ROOT/$BUILD/btl/
+BTL_INC = ./$ROOT/btl/src/
+CXXFLAGS = $CXXFLAGS -I$BTL_INC -DFILE_PTR=FILE*
+
+build $DST/lmerge.cpp.o: cxx $SRC/lmerge.cpp
+build $DST/../lmerge: ld $DST/lmerge.cpp.o $BTL_LIB/btl.a