forked from osquery/osquery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (29 loc) · 941 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
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Darwin)
BUILD_DIR=darwin
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:
mkdir -p build/$(BUILD_DIR)
$(if $(PLATFORM) == Linux, ln -snf $(BUILD_DIR) build/linux)
cd build/$(BUILD_DIR) && cmake ../.. && make --no-print-directory $(MAKEFLAGS)
debug:
mkdir -p build/$(BUILD_DIR)
$(if $(PLATFORM) == Linux, ln -snf $(BUILD_DIR) build/linux)
cd build/$(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug ../../ && \
make --no-print-directory $(MAKEFLAGS)
deps:
./tools/provision.sh
distclean:
rm -rf .sources build/$(BUILD_DIR) doxygen/html doxygen/latex
$(if $(PLATFORM) == Linux, rm -rf build/linux)
%::
mkdir -p build/$(BUILD_DIR)
$(if $(PLATFORM) == Linux, ln -snf $(BUILD_DIR) build/linux)
cd build/$(BUILD_DIR) && cmake ../.. && make --no-print-directory $@