Skip to content

Commit 8ac30da

Browse files
committed
Switch our cmake projects from ninja to make
Ninja is nicer but make has the key feature of integrating with the jobserver of the top-level Makefile Fixes pyston#75 part 2
1 parent f0e5aea commit 8ac30da

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Makefile

+18-18
Original file line numberDiff line numberDiff line change
@@ -26,47 +26,47 @@ tune: pyston/build/system_env/bin/python
2626
tune_reset: pyston/build/system_env/bin/python
2727
PYTHONPATH=pyston/tools pyston/build/system_env/bin/python -c "import tune; tune.untune()"
2828

29-
pyston/build/Release/build.ninja:
29+
pyston/build/Release/Makefile:
3030
mkdir -p pyston/build/Release
3131
@# Use gold linker since ld 2.32 (Ubuntu 19.04) is unable to link compiler-rt:
32-
cd pyston/build/Release; CC=clang CXX=clang++ cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_PROJECTS="clang;compiler-rt" -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
32+
cd pyston/build/Release; CC=clang CXX=clang++ cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_PROJECTS="clang;compiler-rt" -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
3333

34-
pyston/build/PartialDebug/build.ninja:
34+
pyston/build/PartialDebug/Makefile:
3535
mkdir -p pyston/build/PartialDebug
36-
cd pyston/build/PartialDebug; CC=clang CXX=clang++ cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=PartialDebug -DLLVM_ENABLE_PROJECTS=clang -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
36+
cd pyston/build/PartialDebug; CC=clang CXX=clang++ cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=PartialDebug -DLLVM_ENABLE_PROJECTS=clang -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
3737

38-
pyston/build/Debug/build.ninja:
38+
pyston/build/Debug/Makefile:
3939
mkdir -p pyston/build/Debug
40-
cd pyston/build/Debug; CC=clang CXX=clang++ cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
40+
cd pyston/build/Debug; CC=clang CXX=clang++ cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang -DLLVM_USE_PERF=ON -DCLANG_INCLUDE_TESTS=0 -DCOMPILER_RT_INCLUDE_TESTS=0 -DLLVM_INCLUDE_TESTS=0
4141

4242
.PHONY: build_release build_dbg build_debug
43-
build_dbg: pyston/build/PartialDebug/build.ninja pyston/build/bc_env/bin/python
44-
cd pyston/build/PartialDebug; ninja libinterp.so libpystol.so
45-
build_debug: pyston/build/Debug/build.ninja pyston/build/bc_env/bin/python
46-
cd pyston/build/Debug; ninja libinterp.so libpystol.so
43+
build_dbg: pyston/build/PartialDebug/Makefile pyston/build/bc_env/bin/python
44+
cd pyston/build/PartialDebug; $(MAKE) libinterp.so libpystol.so
45+
build_debug: pyston/build/Debug/Makefile pyston/build/bc_env/bin/python
46+
cd pyston/build/Debug; $(MAKE) libinterp.so libpystol.so
4747

4848
# The "%"s here are to force make to consider these as group targets and not run this target multiple times
49-
pyston/build/Release/nitrous/libinterp%so pyston/build/Release/pystol/libpystol%so: pyston/build/Release/build.ninja pyston/build/bc_env/bin/python $(wildcard pyston/nitrous/*.cpp) $(wildcard pyston/nitrous/*.h) $(wildcard pyston/pystol/*.cpp) $(wildcard pyston/pystol/*.h)
50-
cd pyston/build/Release; ninja libinterp.so libpystol.so
49+
pyston/build/Release/nitrous/libinterp%so pyston/build/Release/pystol/libpystol%so: pyston/build/Release/Makefile pyston/build/bc_env/bin/python $(wildcard pyston/nitrous/*.cpp) $(wildcard pyston/nitrous/*.h) $(wildcard pyston/pystol/*.cpp) $(wildcard pyston/pystol/*.h)
50+
cd pyston/build/Release; $(MAKE) libinterp.so libpystol.so
5151
@# touch them since our dependencies in this makefile are not 100% correct, and they might not have gotten rebuilt:
5252
touch pyston/build/Release/nitrous/libinterp.so pyston/build/Release/pystol/libpystol.so
5353
build_release:
5454
$(MAKE) pyston/build/Release/nitrous/libinterp.so pyston/build/Release/pystol/libpystol.so
5555

5656
LLVM_TOOLS:=$(CLANG)
5757
.PHONY: clang
58-
clang $(CLANG): | pyston/build/Release/build.ninja
59-
cd pyston/build/Release; ninja clang llvm-dis llvm-as llvm-link opt compiler-rt llvm-profdata
58+
clang $(CLANG): | pyston/build/Release/Makefile
59+
cd pyston/build/Release; $(MAKE) clang llvm-dis llvm-as llvm-link opt compiler-rt llvm-profdata
6060

6161
BOLT:=pyston/build/bolt/bin/llvm-bolt
6262
PERF2BOLT:=pyston/build/bolt/bin/perf2bolt
6363
MERGE_FDATA:=pyston/build/bolt/bin/merge-fdata
64-
pyston/build/bolt/build.ninja:
64+
pyston/build/bolt/Makefile:
6565
mkdir -p pyston/build/bolt
66-
cd pyston/build/bolt; cmake -G Ninja ../../bolt/bolt/llvm -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_TESTS=0 -DLLVM_ENABLE_PROJECTS=bolt
66+
cd pyston/build/bolt; cmake -G "Unix Makefiles" ../../bolt/bolt/llvm -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_TESTS=0 -DLLVM_ENABLE_PROJECTS=bolt
6767
bolt: $(BOLT)
68-
$(BOLT): pyston/build/bolt/build.ninja
69-
cd pyston/build/bolt; ninja llvm-bolt merge-fdata perf2bolt
68+
$(BOLT): pyston/build/bolt/Makefile
69+
cd pyston/build/bolt; $(MAKE) llvm-bolt merge-fdata perf2bolt
7070

7171
# this flags are what the default debian/ubuntu cpython uses
7272
CPYTHON_EXTRA_CFLAGS:=-fstack-protector -specs=$(CURDIR)/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2

0 commit comments

Comments
 (0)