forked from osquery/osquery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (35 loc) · 930 Bytes
/
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
PLATFORM := $(shell uname -s)
MAKE = make
ifeq ($(PLATFORM),Darwin)
BUILD_DIR=darwin
else ifeq ($(PLATFORM),FreeBSD)
BUILD_DIR=freebsd
MAKE=gmake
else
DISTRO := $(shell if [ -f "/etc/redhat-release" ]; then echo "Centos"; fi)
ifeq ($(DISTRO),Centos)
BUILD_DIR=centos
else
BUILD_DIR=ubuntu
endif
endif
all: .setup
cd build/$(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE= ../.. && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
debug: .setup
cd build/$(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug ../../ && \
$(MAKE) --no-print-directory $(MAKEFLAGS)
deps: .setup
./tools/provision.sh build build/$(BUILD_DIR)
distclean:
rm -rf .sources build/$(BUILD_DIR) doxygen/html doxygen/latex
ifeq ($(PLATFORM),Linux)
rm -rf build/linux
endif
.setup:
mkdir -p build/$(BUILD_DIR)
ifeq ($(PLATFORM),Linux)
ln -snf $(BUILD_DIR) build/linux
endif
%::
cd build/$(BUILD_DIR) && cmake ../.. && $(MAKE) --no-print-directory $@