-
-
Notifications
You must be signed in to change notification settings - Fork 145
/
Tupfile
74 lines (63 loc) · 1.73 KB
/
Tupfile
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
include_rules
ifeq ($(TUP_SERVER),ldpreload)
ifeq ($(X86_ARCH_SIBLINGS),y)
: src/ldpreload/*.64.o |> !ld |> tup-ldpreload.so
else
: src/ldpreload/*.o |> !ld |> tup-ldpreload.so
endif
endif
ifneq ($(TARGET),win32)
client_objs += src/tup/vardict.o
client_objs += src/tup/send_event.o
client_objs += src/tup/flock/fcntl.o
: $(client_objs) |> !ar |> libtup_client.a
: src/tup/vardict.h |> !cp |> tup_client.h
endif
srcs = src/tup/*.o
srcs += src/tup/tup/*.o
srcs += src/tup/monitor/*.o
srcs += src/tup/flock/*.o
srcs += src/tup/server/*.o
ifeq (@(TUP_USE_SYSTEM_INIH),y)
LDFLAGS += -linih
else
srcs += src/inih/*.o
endif
srcs += src/compat/*.o
ifeq (@(TUP_USE_SYSTEM_SQLITE),y)
LDFLAGS += -lsqlite3
else
srcs += src/sqlite3/*.o
endif
ifeq ($(use_system_pcre),y)
LDFLAGS += `pcre2-config --libs8`
else
srcs += src/pcre/*.o
endif
ifneq ($(TARGET),win32)
ifeq (@(TUP_SUDO_SUID),y)
suid = ; chown root:$(TUP_SUID_GROUP) tup; chmod u+s tup
endif
ifeq ($(TUP_SERVER),fuse)
LDFLAGS += `pkg-config fuse --libs`
endif
ifeq ($(TUP_SERVER),fuse3)
LDFLAGS += `pkg-config fuse3 --libs`
endif
LDFLAGS += -lm
LDFLAGS += -lpthread
else
: src/dllinject/*.o |> !dll -lpsapi |> tup-dllinject.dll
: src/dllinject/*.o32 |> !dll32 -lpsapi |> tup-dllinject32.dll
: src/compat/win32/detect/*.o32 |> !ld32 |> tup32detect$(PROGRAM_SUFFIX)
srcs += src/compat/win32/*.o
srcs += tup-dllinject.dll
LDFLAGS += -Wl,--wrap=open
LDFLAGS += -Wl,--wrap=close
LDFLAGS += -Wl,--wrap=tmpfile
LDFLAGS += -Wl,--wrap=dup
LDFLAGS += -Wl,--wrap=__mingw_vprintf
LDFLAGS += -Wl,--wrap=__mingw_vfprintf
LDFLAGS += -Wl,-Bstatic -lpthread -Wl,-Bdynamic
endif
: $(srcs) src/lua/liblua.a |> ^ LINK %o^ ./src/tup/link.sh "$(CC)" "$(CFLAGS)" "$(LDFLAGS)" "%1o" "%2o" "%f" $(suid) |> tup$(PROGRAM_SUFFIX) tup-version.o