osquery-1/Makefile

65 lines
1.6 KiB
Makefile
Raw Normal View History

PLATFORM := $(shell uname -s)
2014-11-06 11:15:26 +00:00
MAKE = make
ifeq ($(PLATFORM),Darwin)
BUILD_DIR=darwin
2014-11-06 08:16:28 +00:00
else ifeq ($(PLATFORM),FreeBSD)
BUILD_DIR=freebsd
2014-11-16 20:29:50 +00:00
MAKE=gmake
else
DISTRO := $(shell if [ -f "/etc/redhat-release" ]; then echo "Centos"; fi)
ifeq ($(DISTRO),Centos)
BUILD_DIR=centos
else
DISTRO := $(shell if [ -f "/etc/lsb-release" ]; then echo "Ubuntu"; fi)
BUILD_DIR := $(shell lsb_release -sc)
endif
endif
2014-11-09 00:55:19 +00:00
all: .setup
cd build/$(BUILD_DIR) && cmake ../.. && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
2014-11-09 00:55:19 +00:00
debug: .setup
cd build/$(BUILD_DIR) && DEBUG=True cmake ../../ && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
analyze: .setup
cd build/$(BUILD_DIR) && ANALYZE=True cmake ../../ && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
2015-01-31 11:26:28 +00:00
sanitize: .setup
cd build/$(BUILD_DIR) && SANITIZE=True cmake ../../ && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
2015-02-03 05:21:36 +00:00
sdk: .setup
2015-02-10 01:31:54 +00:00
cd build/$(BUILD_DIR)/sdk && SDK=True cmake ../../../ && \
2015-02-03 05:21:36 +00:00
$(MAKE) --no-print-directory $(MAKEFLAGS)
test_sdk: .setup
2015-02-10 01:31:54 +00:00
cd build/$(BUILD_DIR)/sdk && SDK=True cmake ../../../ && \
2015-02-03 05:21:36 +00:00
$(MAKE) test --no-print-directory $(MAKEFLAGS)
2014-11-09 00:55:19 +00:00
deps: .setup
./tools/provision.sh build build/$(BUILD_DIR)
distclean:
rm -rf .sources build/$(BUILD_DIR) doxygen/html doxygen/latex
2014-11-09 00:55:19 +00:00
ifeq ($(PLATFORM),Linux)
rm -rf build/linux
endif
2014-11-09 00:55:19 +00:00
.setup:
2015-02-05 01:31:06 +00:00
mkdir -p build/$(BUILD_DIR)/generated
mkdir -p build/$(BUILD_DIR)/sdk/generated
2014-11-09 00:55:19 +00:00
ifeq ($(PLATFORM),Linux)
ln -snf $(BUILD_DIR) build/linux
endif
2015-01-11 07:02:32 +00:00
package:
# Alias for packages (do not use CPack)
cd build/$(BUILD_DIR) && cmake ../../ && \
2015-01-11 07:02:32 +00:00
$(MAKE) packages --no-print-directory $(MAKEFLAGS)
2014-11-09 00:55:19 +00:00
%::
cd build/$(BUILD_DIR) && cmake ../.. && $(MAKE) --no-print-directory $@