forked from cross-rs/cross
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNested.mk
More file actions
58 lines (46 loc) · 1.44 KB
/
Nested.mk
File metadata and controls
58 lines (46 loc) · 1.44 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
# this is a special makefile checking we handle nested
# conditionals properly, that removing sections won't
# cause unequal conditional blocks. it may still lead
# to missing definitions, but it won't fail due to
# unmatched if and endif directives.
LOCAL_PATH := $(call my-dir)
ifneq ($(ENV1),)
# -----------------------------------------------------------------------------
# Benchmarks.
# -----------------------------------------------------------------------------
test_tags := tests
benchmark_c_flags := \
-Wall -Wextra \
-Werror \
-fno-builtin \
benchmark_src_files := benchmark_main.cc
ifneq ($(ENV2),)
benchmark_src_files += bench1.cc
else
benchmark_src_files += bench2.cc
endif
# Build benchmarks.
include $(CLEAR_VARS)
LOCAL_MODULE := benchmarks
LOCAL_MODULE_TAGS := tests
LOCAL_CFLAGS += $(benchmark_c_flags)
LOCAL_SHARED_LIBRARIES += libm libdl
LOCAL_SRC_FILES := $(benchmark_src_files)
endif
# Other section.
# =========================================================
include $(call all-makefiles-under,$(LOCAL_PATH))
# =============================================================================
# Unit tests.
# =============================================================================
test_c_flags := \
-g \
-Wall \
-Werror
##################################
# test executable
LOCAL_MODULE := mod2
LOCAL_SRC_FILES := mod.c
LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_CFLAGS := $(test_c_flags)
LOCAL_MODULE_RELATIVE_PATH := mod2-tests