Restructure.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
out
|
||||
build.ninja
|
||||
|
||||
7
Makefile
7
Makefile
@ -166,9 +166,10 @@ fast: posix esp32_sim esp32
|
||||
targets: $(TARGETS)
|
||||
tests: $(TESTS)
|
||||
|
||||
n:
|
||||
mkdir -p out
|
||||
tools/configure.py >out/build.ninja
|
||||
build.ninja: ./configure.py
|
||||
$<
|
||||
|
||||
n: build.ninja
|
||||
ninja
|
||||
|
||||
clean-esp32:
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
builddir = out
|
||||
include out/build.ninja
|
||||
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
@ -22,7 +23,7 @@ STABLE_VERSION = '7.0.6.19'
|
||||
OLD_STABLE_VERSION = '7.0.5.4'
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
ROOT_DIR = os.path.dirname(SCRIPT_DIR)
|
||||
ROOT_DIR = SCRIPT_DIR
|
||||
|
||||
REVISION = 'TODO'
|
||||
#REVISION=$(shell git rev-parse HEAD | head -c 20)
|
||||
@ -130,6 +131,7 @@ output = f"""
|
||||
ninja_required_version = 1.1
|
||||
src = .
|
||||
dst = out
|
||||
builddir = $dst
|
||||
VERSION = {VERSION}
|
||||
REVISION = {REVISION}
|
||||
CFLAGS = {' '.join(CFLAGS)}
|
||||
@ -172,12 +174,12 @@ rule compile_sim
|
||||
rule compile_win32
|
||||
description = WIN_CL32
|
||||
deps = msvc
|
||||
command = $WIN_CL32 /showIncludes /nologo /c /Fo$out $WIN_CFLAGS $in && touch $out
|
||||
command = $WIN_CL32 /showIncludes /nologo /c /Fo$out $WIN_CFLAGS $in | $src/tools/posixify.py && touch $out
|
||||
|
||||
rule compile_win64
|
||||
description = WIN_CL64
|
||||
deps = msvc
|
||||
command = $WIN_CL64 /showIncludes /nologo /c /Fo$out $WIN_CFLAGS $in && touch $out
|
||||
command = $WIN_CL64 /showIncludes /nologo /c /Fo$out $WIN_CFLAGS $in | $src/tools/posixify.py && touch $out
|
||||
|
||||
rule link_win32
|
||||
description = WIN_LINK32
|
||||
@ -385,5 +387,16 @@ def Include(path):
|
||||
exec(data)
|
||||
|
||||
|
||||
def Main():
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='configure',
|
||||
description='Generate ninja.build')
|
||||
parser.add_argument('-o', default='build.ninja')
|
||||
args = parser.parse_args()
|
||||
Include('.')
|
||||
print(output)
|
||||
with open(args.o, 'w') as fh:
|
||||
fh.write(output)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main()
|
||||
5
tools/posixify.py
Executable file
5
tools/posixify.py
Executable file
@ -0,0 +1,5 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
sys.stdout.write(sys.stdin.read().replace('\\', '/'))
|
||||
Reference in New Issue
Block a user