Skip to content

Commit 75389a4

Browse files
authored
Merge pull request #31 from neuromancer/patch-5
Improved support for compiling using multiple CPUs
2 parents 91c5a50 + 9ec86ef commit 75389a4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
CPUS := $(shell grep -c ^processor /proc/cpuinfo)
2+
13
all: build_debug
24
true
35

46
build_debug: box2d premake
57
.build/premake5 gmake --cc=clang
6-
make -C .build config=debug_x86_64 -j $(($(grep -c ^processor /proc/cpuinfo)/2))
8+
make -C .build config=debug_x86_64 -j $$(($(CPUS)/2))
79
test -d bin || mkdir bin
810
cp .build/bin/x86_64/Debug/carnage3d bin/carnage3d-debug
911

1012
build_release: box2d premake
1113
.build/premake5 gmake --cc=clang
12-
make -C .build config=release_x86_64 -j $(($(grep -c ^processor /proc/cpuinfo)/2))
14+
make -C .build config=release_x86_64 -j $$(($(CPUS)/2))
1315
test -d bin || mkdir bin
1416
cp .build/bin/x86_64/Release/carnage3d bin/carnage3d-release
1517

@@ -41,7 +43,7 @@ premake: builddir
4143

4244
box2d: premake
4345
.build/premake5 --file=third_party/Box2D/premake5.lua gmake
44-
make -C third_party/Box2D/Build config=debug_x86_64
45-
make -C third_party/Box2D/Build config=release_x86_64
46+
make -C third_party/Box2D/Build config=debug_x86_64 -j $$(($(CPUS)/2))
47+
make -C third_party/Box2D/Build config=release_x86_64 -j $$(($(CPUS)/2))
4648

4749

0 commit comments

Comments
 (0)