forked from gittup/tup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tupfile
51 lines (45 loc) · 2.14 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
include_rules
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
srcs = src/tup/*.o
srcs += src/tup/monitor/*.o
srcs += src/tup/flock/*.o
srcs += src/tup/server/*.o
ifeq (@(TUP_USE_SYSTEM_SQLITE),y)
LDFLAGS += -lsqlite3
else
srcs += src/sqlite3/*.o
endif
srcs += src/inih/*.o
srcs += src/compat/*.o
: $(srcs) |> !ar |> libtup.a
ifeq (@(TUP_SUDO_SUID),y)
suid = ; chown root:$(TUP_SUID_GROUP) tup; chmod u+s tup
endif
LDFLAGS += `pkg-config fuse --libs`
LDFLAGS += -lm
: src/tup/tup/main.o libtup.a src/lua/liblua.a |> ^ LINK tup^ version=`git describe`; echo "const char *tup_version(void) {return \"$version\";}" | $(CC) -x c -c - -o tup-version.o $(CFLAGS) -Wno-missing-prototypes; $(CC) %f tup-version.o -o tup -lpthread $(LDFLAGS) $(suid) |> tup tup-version.o
ifneq (@(TUP_MINGW),)
: src/dllinject/*.omingw |> ^ MINGWLINK %o^ @(TUP_MINGW)-gcc -shared -static-libgcc %f -lws2_32 -lpsapi -lshlwapi -o %o |> tup-dllinject.dll
: src/dllinject/*.omingw32 |> ^ MINGW32LINK %o^ @(TUP_MINGW32)-gcc -shared -static-libgcc %f -lws2_32 -lpsapi -lshlwapi -o %o |> tup-dllinject32.dll
mingwsrcs = src/tup/*.omingw
mingwsrcs += src/tup/monitor/*.omingw
mingwsrcs += src/tup/tup/*.omingw
mingwsrcs += src/tup/flock/*.omingw
mingwsrcs += src/tup/server/*.omingw
mingwsrcs += src/inih/*.omingw
mingwsrcs += src/sqlite3/*.omingw
mingwsrcs += src/compat/*.omingw
mingwsrcs += src/compat/win32/*.omingw
MINGWLDFLAGS += -Wl,--wrap=open
MINGWLDFLAGS += -Wl,--wrap=close
MINGWLDFLAGS += -Wl,--wrap=tmpfile
MINGWLDFLAGS += -Wl,--wrap=dup
MINGWLDFLAGS += -Wl,--wrap=__mingw_vprintf
MINGWLDFLAGS += -Wl,--wrap=__mingw_vfprintf
: $(mingwsrcs) tup-dllinject.dll src/lua/liblua-mingw.a |> ^ MINGWLINK tup.exe^ version=`git describe`; echo "const char *tup_version(void) {return \"$version\";}" | @(TUP_MINGW)-gcc -x c -c - -o tup-version.omingw; @(TUP_MINGW)-gcc -static-libgcc %f tup-version.omingw $(MINGWLDFLAGS) -o tup.exe |> tup.exe tup-version.omingw
: src/compat/win32/detect/*.omingw32 |> ^ MINGW32LINK %o^ @(TUP_MINGW32)-gcc %f -o %o -m32 |> tup32detect.exe
endif