MYNT-EYE-S-SDK/Makefile

135 lines
2.4 KiB
Makefile
Raw Normal View History

2018-03-08 09:54:14 +02:00
include CommonDefs.mk
.DEFAULT_GOAL := help
help:
@echo "Usage:"
2018-03-09 04:51:09 +02:00
@echo " make help show help message"
@echo " make apidoc make api doc"
@echo " make opendoc open api doc (html)"
@echo " make init init project"
2018-03-11 18:15:30 +02:00
@echo " make build build project"
2018-03-09 04:51:09 +02:00
@echo " make test build test and run"
2018-03-22 06:57:35 +02:00
@echo " make install install project"
2018-03-22 07:03:08 +02:00
@echo " make samples build samples"
2018-03-09 04:51:09 +02:00
@echo " make clean|cleanall clean generated or useless things"
.PHONY: help
# doc
2018-03-08 09:54:14 +02:00
apidoc:
@$(call echo,Make $@)
2018-03-09 05:42:45 +02:00
@$(SH) ./doc/build.sh
2018-03-08 09:54:14 +02:00
opendoc: apidoc
@$(call echo,Make $@)
2018-03-09 05:42:45 +02:00
@$(shell $(SH) ./doc/langs.sh 1); \
2018-03-08 09:54:14 +02:00
for lang in "$${LANGS[@]}"; do \
html=./doc/output/$$lang/html/index.html; \
2018-03-09 05:42:45 +02:00
[ -f "$$html" ] && $(SH) ./scripts/open.sh $$html; \
2018-03-08 09:54:14 +02:00
done
2018-03-08 11:33:41 +02:00
2018-03-09 04:51:09 +02:00
.PHONY: apidoc opendoc
# deps
submodules:
@git submodule update --init
third_party: submodules
@$(call echo,Make $@)
@$(call echo,Make glog,33)
@$(call cmake_build,./third_party/glog/_build)
.PHONY: submodules third_party
2018-03-22 06:57:35 +02:00
# init
init: submodules
@$(call echo,Make $@)
@$(SH) ./scripts/init.sh
.PHONY: init
2018-03-11 18:15:30 +02:00
# build
build: third_party
@$(call echo,Make $@)
@$(call cmake_build,./_build)
.PHONY: build
2018-03-09 04:51:09 +02:00
# test
test: submodules
@$(call echo,Make $@)
@$(call echo,Make gtest,33)
@$(call cmake_build,./tests/gtest/_build)
.PHONY: test
2018-03-22 06:57:35 +02:00
# install
install: build
@$(call echo,Make $@)
@cd ./_build; make install
.PHONY: install
2018-03-22 07:03:08 +02:00
# samples
samples: install
@$(call echo,Make $@)
@$(call cmake_build,./samples/_build)
.PHONY: samples
2018-03-09 04:51:09 +02:00
# clean
clean:
@$(call echo,Make $@)
2018-03-11 18:15:30 +02:00
@$(call rm,./_build/)
@$(call rm,./_output/)
2018-03-22 06:57:35 +02:00
@$(call rm,./_install/)
2018-03-11 18:15:30 +02:00
@$(MAKE) cleanlog
2018-03-09 04:51:09 +02:00
cleanall: clean
@$(call rm,./doc/output/)
2018-03-11 18:15:30 +02:00
@$(call rm,./tests/gtest/_build/)
@$(call rm,./third_party/glog/_build/)
2018-03-09 04:51:09 +02:00
@$(FIND) . -type f -name ".DS_Store" -print0 | xargs -0 rm -f
2018-03-11 18:15:30 +02:00
cleanlog:
@$(call rm_f,*INFO*)
@$(call rm_f,*WARNING*)
@$(call rm_f,*ERROR*)
2018-03-22 07:03:08 +02:00
@$(call rm_f,*FATAL*)
2018-03-11 18:15:30 +02:00
.PHONY: clean cleanall cleanlog
2018-03-09 04:51:09 +02:00
# others
2018-03-08 11:33:41 +02:00
host:
@$(call echo,Make $@)
@echo HOST_OS: $(HOST_OS)
@echo HOST_ARCH: $(HOST_ARCH)
2018-03-09 08:10:42 +02:00
@echo HOST_NAME: $(HOST_NAME)
2018-03-09 05:42:45 +02:00
@echo SH: $(SH)
2018-03-08 11:33:41 +02:00
@echo ECHO: $(ECHO)
2018-03-09 05:42:45 +02:00
@echo FIND: $(FIND)
2018-03-08 11:33:41 +02:00
@echo CC: $(CC)
@echo CXX: $(CXX)
@echo MAKE: $(MAKE)
@echo BUILD: $(BUILD)
@echo LDD: $(LDD)
@echo CMAKE: $(CMAKE)
2018-03-09 04:51:09 +02:00
.PHONY: host
2018-03-11 18:15:30 +02:00
2018-03-22 06:57:35 +02:00
cpplint: submodules
2018-03-11 18:15:30 +02:00
@$(call echo,Make $@)
@$(SH) ./scripts/$@.sh
.PHONY: cpplint