forked from DavidSchinazi/jazzlights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1.93 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
.PHONY: all clean install install-local demo test makeproj xcodeproj verify-examples
SOURCE_DIR:=${CURDIR}
BUILD_DIR:=${CURDIR}/build
CMAKE:=${if ${CMAKE},${CMAKE},cmake}
CMAKE_MAKEPROJ_FLAGS:=\
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY=${BUILD_DIR}/bin \
-D CMAKE_ARCHIVE_OUTPUT_DIRECTORY=${BUILD_DIR}/lib \
-D CMAKE_LIBRARY_OUTPUT_DIRECTORY=${BUILD_DIR}/lib
CMAKE_XCODEPROJ_FLAGS:=\
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${BUILD_DIR}/bin \
-D CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${BUILD_DIR}/lib \
-D CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=${BUILD_DIR}/lib \
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${BUILD_DIR}/bin \
-D CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${BUILD_DIR}/lib \
-D CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=${BUILD_DIR}/lib
CMAKE_BUILD_DIR:=${BUILD_DIR}/tmp
ARDUINO:=${if ${ARDUINO},${ARDUINO},arduino}
ARDUINO_BOARD:=${if ${ARDUINO_BOARD},${ARDUINO_BOARD},"esp8266:esp8266:huzzah:eesz=4M3M,xtal=80"}
all: ${CMAKE_BUILD_DIR}
${CMAKE} --build ${CMAKE_BUILD_DIR}
clean:
${CMAKE} -E remove_directory ${CURDIR}/build
install: all
${CMAKE} -P ${CMAKE_BUILD_DIR}/cmake_install.cmake
demo: ${CMAKE_BUILD_DIR}
${CMAKE} --build ${CMAKE_BUILD_DIR} --config release --target jazzlights-demo
LD_LIBRARY_PATH=${BUILD_DIR}/lib \
${BUILD_DIR}/bin/jazzlights-demo ${SOURCE_DIR}/extras/demo/matrix.toml
bench: ${CMAKE_BUILD_DIR}
${CMAKE} --build ${CMAKE_BUILD_DIR} --config release --target jazzlights-bench
LD_LIBRARY_PATH=${BUILD_DIR}/lib ${BUILD_DIR}/bin/jazzlights-bench
test: ${CMAKE_BUILD_DIR}
${CMAKE} --build ${CMAKE_BUILD_DIR} --config debug --target jazzlights-test
LD_LIBRARY_PATH=${BUILD_DIR}/lib ${BUILD_DIR}/bin/jazzlights-test
xcodeproj: clean
${CMAKE} -E make_directory ${CMAKE_BUILD_DIR}
cd ${CMAKE_BUILD_DIR} && ${CMAKE} -G Xcode ${CMAKE_XCODEPROJ_FLAGS} ${SOURCE_DIR}/extras
makeproj: clean ${CMAKE_BUILD_DIR}
${CMAKE_BUILD_DIR}:
${CMAKE} -E make_directory $@
cd $@ && ${CMAKE} ${CMAKE_MAKEPROJ_FLAGS} ${SOURCE_DIR}/extras