-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
Tuprules.tup
117 lines (99 loc) · 2.25 KB
/
Tuprules.tup
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.gitignore
ifdef TARGET
TARGET = @(TARGET)
else
TARGET = @(TUP_PLATFORM)
endif
ifeq (@(TUP_DEBUG),y)
CFLAGS += -Og
else
CFLAGS += -Os
endif
CFLAGS += -g
ifeq (@(TUP_SANITIZE),y)
CFLAGS += -fsanitize=address
LDFLAGS += -lasan
CFLAGS += -fsanitize=undefined
LDFLAGS += -lubsan
endif
CFLAGS += -W
CFLAGS += -Wall
ifeq (@(TUP_WERROR),y)
CFLAGS += -Werror
endif
CFLAGS += -Wbad-function-cast
CFLAGS += -Wcast-align
CFLAGS += -Wcast-qual
CFLAGS += -Wchar-subscripts
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wnested-externs
CFLAGS += -Wpointer-arith
CFLAGS += -Wredundant-decls
CFLAGS += -Wshadow
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wwrite-strings
CFLAGS += -Wswitch-enum
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -fno-common
CFLAGS += -I$(TUP_VARIANTDIR)/src
CFLAGS += -I$(TUP_CWD)/src
ifeq (@(TUP_32_BIT),y)
CFLAGS += -m32
LDFLAGS += -m32
endif
ifeq (@(TUP_PROFILING),y)
CFLAGS += -pg
LDFLAGS += -pg
endif
!cc = |> ^ CC %f^ $(CC) -c %f -o %o $(CFLAGS) $(CFLAGS_%f) |> %B.o
!ld = |> ^ LINK %o^ $(CC) %f -o %o $(LDFLAGS) $(LDFLAGS_%o) |>
!ar = |> ^ AR %o^ $(AR) crs %o %f |>
!dot = |> ^ DOT %f^ dot -Efontname="Vernada, serif" -Nfontname="Vernada, serif" -Efontsize=10 -Nfontsize=10 -Tpng %f > %o |>
!cp = |> ^ CP %f -> %o^ cp %f %o |>
# Default to using gcc to compile. This is overridden on some OSes in the
# included $(TARGET).tup file, and can be overridden by the user in the
# tup.config file by setting CONFIG_CC (and/or CONFIG_CC32 on Windows).
CC = gcc
AR = ar
TUP_MONITOR = null
TUP_SUID_GROUP = root
TUP_USE_SYSTEM_PCRE = y
include $(TARGET).tup
ifdef CC
CC = @(CC)
endif
ifdef CC32
CC32 = @(CC32)
endif
ifdef AR
AR = @(AR)
endif
# Override AR settings if being built with busybox kconfig
ifeq ($(AR),y)
AR = ar
endif
ifeq ($(AR),n)
AR = ar
endif
ifdef TUP_USE_SYSTEM_PCRE
use_system_pcre = @(TUP_USE_SYSTEM_PCRE)
else
use_system_pcre = $(TUP_USE_SYSTEM_PCRE)
endif
ifeq ($(use_system_pcre),y)
CFLAGS += `pcre2-config --cflags`
else
CFLAGS += -I$(TUP_CWD)/src/pcre
CFLAGS += -DPCRE_STATIC
endif
ifneq (@(TUP_USE_SYSTEM_INIH),y)
CFLAGS += -I$(TUP_CWD)/src/inih
endif
ifeq ($(TUP_SERVER),ldpreload)
FPIC = -fpic
SHARED = -shared
LDFLAGS_tup-ldpreload.so += $(FPIC)
LDFLAGS_tup-ldpreload.so += $(SHARED)
LDFLAGS_tup-ldpreload.so += -ldl
LDFLAGS_tup-ldpreload.so += -pthread
endif