Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 66 lines (49 sloc) 1.563 kb
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
PROJECT_ROOT = .
include src/dirs.mk

TEST := $(if $(OUT_TOP),$(OUT_TOP),test/)test

TOBUILD := $(filter clean% clobber% both debug release, $(MAKECMDGOALS))
CLEAN := $(filter clean% clobber%,$(MAKECMDGOALS))
TOTEST := $(filter-out $(TOBUILD), $(MAKECMDGOALS))

ifeq ($(if $(TOBUILD),1)$(if $(TOTEST),1),11)
$(TOTEST) : $(TOBUILD)
endif

ifneq ($(filter fast_tests slow_tests $(FAST_TESTS) $(SLOW_TESTS) TestCodeRun%,$(MAKECMDGOALS)),)
# run all tests, even if some fail
MAKEFLAGS += k
.NOTPARALLEL:
endif

QuickTests = "" "" $@
TestExt = "" "" $@
FAST_TESTS := QuickTests TestExt TestCodeRunEval
SLOW_TESTS := TestCodeRun TestServer

all: fast_tests
tags: ctags etags
ctags:
-$(V)cd src && ct
etags:
-$(V)cd src && ct -e
.PHONY: tags ctags etags

$(FAST_TESTS) $(SLOW_TESTS) TestCodeRunStatic: % : setup
cd src && $(TEST) $(if $($@),$($@),$@)

setup: $(CLEAN)
$(MAKE) -C src

fast_tests: $(FAST_TESTS)
slow_tests: $(SLOW_TESTS)

.PHONY: $(FAST_TESTS) $(SLOW_TESTS) TestCodeRun%

TestCodeRun-% TestCodeRunEval-% TestCodeRunStatic-% TestServer-% : setup
cd src && $(TEST) $(patsubst %-$*,%,$@) Test$*

.PHONY: debug release both check_by_type fast_tests slow_tests setup
check_by_type: $(CLEAN)
@if [ -z "$$OUTDIR_BY_TYPE" ] ; then \
echo "You need to set OUTDIR_BY_TYPE to build both DEBUG and RELEASE into the same client"; \
exit 1; \
fi

release: check_by_type
$(MAKE) -Csrc RELEASE=1 DEBUG=

debug: check_by_type
$(MAKE) -Csrc RELEASE= DEBUG=1

both: debug release

clobber:
$(MAKE) -C src clobber
$(MAKE) -C facebook clobber

clean: clobber
Something went wrong with that request. Please try again.