-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTuprules.tup
More file actions
61 lines (49 loc) · 1.29 KB
/
Tuprules.tup
File metadata and controls
61 lines (49 loc) · 1.29 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
# Tuprules.tup - Shared build rules for pup
ROOT = $(TUP_CWD)
# OS API (posix or win32) - fallback for configure pass when no tup.config exists
ifeq (@(OS_API),)
_os_api = posix
else
_os_api = @(OS_API)
endif
# Object extension from config (default: o)
ifeq (@(OBJ_EXT),)
_obj = o
else
_obj = @(OBJ_EXT)
endif
# Library extension from config (default: a)
ifeq (@(LIB_EXT),)
_lib = a
else
_lib = @(LIB_EXT)
endif
# Executable extension from config (default: empty)
_exe = @(EXE_EXT)
# Toolchain from config
CC = @(CC)
CXX = @(CXX)
AR = @(AR)
LINKER = @(LINKER)
# Flags from config
CFLAGS = @(CFLAGS)
CFLAGS += -I$(ROOT)/third_party
CXXFLAGS = @(CXXFLAGS)
CXXFLAGS += -I$(ROOT)/include -I$(ROOT)/third_party
LDFLAGS = @(RELEASE_LDFLAGS) @(PLATFORM_LDFLAGS)
# Build mode flags
CFLAGS += @(DEBUG_CFLAGS) @(RELEASE_CFLAGS)
CXXFLAGS += @(DEBUG_CXXFLAGS) @(RELEASE_CXXFLAGS)
# Optional LTO (putup -D LTO or CONFIG_LTO=y in tup.config)
ifdef LTO
CFLAGS += -flto
CXXFLAGS += -flto
LDFLAGS += -flto
endif
# Macros - commands from config
!cc = |> ^ CC %f^ @(CC_CMD) |> %B.$(_obj)
!cc_thirdparty = |> ^ CC %f^ @(CC_THIRDPARTY_CMD) |> %B.$(_obj)
!cxx = |> ^ CXX %f^ @(CXX_CMD) |> %B.$(_obj)
!cxx_thirdparty = |> ^ CXX %f^ @(CXX_THIRDPARTY_CMD) |> %B.$(_obj)
!link = |> ^ LINK %o^ @(LINK_CMD) |>
!ar = |> ^ AR %o^ @(AR_CMD) |>