forked from facebookarchive/fb-adb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am.fb-adb
114 lines (94 loc) · 3.02 KB
/
Makefile.am.fb-adb
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
# -*- makefile-automake -*-
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in
# the LICENSE file in the root directory of this source tree. An
# additional grant of patent rights can be found in the PATENTS file
# in the same directory.
#
libfb_adb_a_SOURCES += \
stubs.h \
$(EMPTY)
CMD_SOURCES += \
cmd_fget.c \
cmd_fput.c \
cmd_logcat_json.c \
cmd_shex.c \
peer.c \
peer.h \
$(EMPTY)
SUBDIRS = $(STUB_SUBDIRS)
DIST_SUBDIRS =
bin_PROGRAMS = fb-adb
AM_CPPFLAGS += -DFBADB_MAIN=1 -DFBADB_CHANNEL_NONBLOCK_HACK=1
CMDSPROC_ENV = main
CMDSPROC_FLAGS += -DFBADB_MAIN
if HAVE_LOCAL_STUB
CMDSPROC_FLAGS += -DHAVE_LOCAL_STUB
endif
AM_MAKEFLAGS += FB_ADB_RECURSIVE=1
update-all-stubs: $(STUB_BINARIES:/stub=/.update-stub)
$(STUB_BINARIES:/stub=/.update-stub): timestamp.c
cp -fp timestamp.c ${@:.update-stub=}timestamp.c
$(MAKE) -C ${@:.update-stub=} $(AM_MAKEFLAGS) stub
update-all-stub-libs: $(STUB_BINARIES:/stub=/.update-lib)
$(STUB_BINARIES:/stub=/.update-lib):
$(MAKE) -C ${@:.update-lib=} $(AM_MAKEFLAGS) libfb-adb.a.stripped
nodist_fb_adb_SOURCES += stubs.c
CLEANFILES += stubs.c
stubs.c: $(srcdir)/mkstubsc.sh update-all-stubs
XXD="$(XXD)" $(srcdir)/mkstubsc.sh $(STUB_BINARIES) > [email protected]
cmp 2>/dev/null $@ [email protected] || mv -f [email protected] $@
EXTRA_DIST += mk-fingerprint.py arpy.py
CLEANFILES += fingerprint
fingerprint: update-all-stub-libs
echo $(STUB_SUBDIRS) | \
tr ' ' '\n' | \
sed -e 's,$$,/libfb-adb.a.stripped,' | \
xargs $(PYTHON3) \
$(srcdir)/mk-fingerprint.py -- \
cmp 2>/dev/null $@ [email protected] || mv -f [email protected] $@
CLEANFILES += timestamp.c
timestamp.c: timestamp.c.in fingerprint
$(SED) -e "s/@FINGERPRINT@/`cat fingerprint`/" \
$< > $@
if GIT_STAMP
echo '{' >> $@
cd "$(top_srcdir)" && git status --porcelain >/dev/null
( cd "$(top_srcdir)" && git rev-parse HEAD ) | \
tr -d '\n' | \
$(XXD) -i >> $@
if ( cd "$(top_srcdir)" && \
git status --porcelain | \
grep -v '^?? ' | \
grep -q . ); \
then echo -n ',' >> $@ && echo -n ' (modified)' | $(XXD) -i >> $@; fi
echo ', 0x00 };' >> $@
endif
EXTRA_DIST += README.md LICENSE PATENTS NEWS stub-config.sh
EXTRA_DIST += timestamp.c.in termnames.h.in termnames.sed
EXTRA_DIST += mkstubsc.sh commands.xml cmdsproc.py
man_MANS = fb-adb.1
CLEANFILES += fb-adb.pod
fb-adb.pod: $(COMMANDS_XML) $(srcdir)/cmdsproc.py
$(CMDSPROC) pod $(COMMANDS_XML) > $@
# podchecker -warnings -warnings $@
CLEANFILES += fb-adb.html.pod
fb-adb.html.pod: $(COMMANDS_XML) $(srcdir)/cmdsproc.py
$(CMDSPROC) -DHTML pod $(COMMANDS_XML) > $@
CLEANFILES += htmldoc.css
htmldoc.css: $(srcdir)/htmldoc.css.in
cat $< > $@
CLEANFILES += index.html
index.html: fb-adb.html.pod $(srcdir)/fixhtmldoc.sed htmldoc.css
pod2html $< | ( cd $(srcdir) && sed -f fixhtmldoc.sed ) > $@
CLEANFILES += fb-adb.1
fb-adb.1: fb-adb.pod
$(POD2MAN) -r"fb-adb $(VERSION)" -s1 -uvc "Facebook" $< > $@
distclean-local:
+for stub in $(STUB_SUBDIRS); do \
$(MAKE) $(AM_MAKEFLAGS) -C $$stub distclean; \
done
rmdir $(STUB_SUBDIRS)