-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (30 loc) · 1007 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
PYTHON ?= python
BUILDTYPE ?= Release
GYP=./tools/gyp-next/gyp
CPPLINT=./tools/cpplint/cpplint.py
CLANG_FORMAT=./tools/node_modules/.bin/clang-format
MAIN_GYP_FILE=./libencode.gyp
out/$(BUILDTYPE)/libencode.a: out/$(BUILDTYPE)/Makefile
make -C out BUILDTYPE=$(BUILDTYPE) libencode
example: out/$(BUILDTYPE)/example
out/$(BUILDTYPE)/example: out/$(BUILDTYPE)/Makefile
make -C out BUILDTYPE=$(BUILDTYPE) example
out/$(BUILDTYPE)/Makefile: $(MAIN_GYP_FILE)
$(GYP) \
--depth=. \
--generator-output=./out \
-Goutput_dir=. \
-fmake \
$(MAIN_GYP_FILE)
$(GYP) \
--depth=. \
--generator-output=./out \
-Goutput_dir=./out \
-fcompile_commands_json \
$(MAIN_GYP_FILE)
CPP_FILES=$(shell find src include -type f ! -name '*-data.cc' -name '*.cc' -or -name '*.h')
lint-cpp: $(CPP_FILES)
$(CPPLINT) $(CPP_FILES) src/urlencode-data.cc
clang-format: $(CPP_FILES)
$(CLANG_FORMAT) -i --style=file $(CPP_FILES)
.PHONY: out/$(BUILDTYPE)/libencode.a out/$(BUILDTYPE)/example lint-cpp clang-format