-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
75 lines (62 loc) · 2.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 2010 NVIDIA Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Developed by Mustard Seed Software, LLC
# http://mseedsoft.com
#
# @author <a href="mailto:[email protected]">Ashlie B. Hocking</a>
# Makefile
ifndef OSTYPE
OSTYPE = $(shell uname)
endif
# Get the number of processors
ifeq ("$(OSTYPE)","Darwin")
CPU_COUNT=2
else
CPU_COUNT := $(shell cat /proc/cpuinfo | grep -P "processor\t" | wc -l)
ifeq ($(CPU_COUNT),0)
CPU_COUNT=1
endif
endif
# Set the number of build threads to the number of processors
ARGS=-j ${CPU_COUNT}
ifeq ($(TERM),msys)
CMAKE_FLAGS = -G "MSYS Makefiles"
endif
BLD=build
.PHONY: default test xcode vs clean
default:
(mkdir -p $(BLD); cd $(BLD); cmake $(CMAKE_FLAGS) ..; make ${ARGS})
test: $(BLD)
(cd $(BLD); make test)
XBLD=build.xc
xcode:
(mkdir -p ${XBLD}; cd ${XBLD}; cmake .. -DTESTING:BOOL=OFF -G"Xcode"; open VisualizePhysics-Wave.xcodeproj)
XBLDT=build.xc-test
xcode-test:
(mkdir -p ${XBLDT}; cd ${XBLDT}; cmake .. -G"Xcode"; open VisualizePhysics-Wave.xcodeproj)
WBLD=build-win32
win32pkg: win32cross
(cd ${WBLD}; make package)
win32cross:
(git clone -b stable https://github.com/mxe/mxe.git mingw;cp -u BuildScripts/openscenegraph-1-pkg-config.patch mingw/src/; cd mingw; make ${ARGS} JOBS=${CPU_COUNT} openscenegraph qt jpeg glew;cd ..;mkdir -p ${WBLD}; cd ${WBLD}; cmake -DCMAKE_TOOLCHAIN_FILE=../mingw/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake .. -DWIN32=1; make ${ARGS} install)
VSBLD=build-vs
vs:
make.bat vs
clean:
rm -rf $(BLD) $(XBLD) $(VSBLD) $(XBLDT)
install:
(mkdir -p $(BLD); cd $(BLD); cmake $(CMAKE_FLAGS) ..; make ${ARGS} install)
package:
(mkdir -p $(BLD); cd $(BLD); cmake $(CMAKE_FLAGS) ..; make ${ARGS} package)