-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile.am
154 lines (131 loc) · 3.74 KB
/
Makefile.am
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = autogen.sh build-aux/version.sh README.md doc/doxygen.cfg
GIT_VERSION := $(shell $(top_srcdir)/build-aux/version.sh)
.PHONY: force
git-version: force
echo '$(GIT_VERSION)' | cmp -s - $@ || echo '$(GIT_VERSION)' > $@
AM_MAKEFLAGS = --no-print-directory
AM_CFLAGS = \
-I$(top_srcdir)/src \
-DMXT_VERSION=\"$(GIT_VERSION)\" \
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_GNU_SOURCE=1
AM_LDFLAGS = \
-Wl,--gc-sections \
-Wl,--as-needed \
-lm
if !DEBUG
AM_CFLAGS += -DNDEBUG
endif
bin_PROGRAMS = mxt-app
noinst_LTLIBRARIES = libmaxtouch.la
check_PROGRAMS = run-unit-tests
run_unit_tests_SOURCES =\
src/test/run_unit_tests.c \
src/test/test_utilfuncs.c \
src/test/test_sensor_variant.c \
src/mxt-app/mxt_app.h \
src/mxt-app/broken_line.c \
src/mxt-app/sensor_variant.c \
src/mxt-app/polyfit.c \
src/mxt-app/menu.c \
src/mxt-app/bootloader.c \
src/mxt-app/diagnostic_data.c \
src/mxt-app/touch_app.c \
src/mxt-app/self_test.c \
src/mxt-app/bridge.c \
src/mxt-app/gr.c \
src/mxt-app/serial_data.c \
src/mxt-app/buffer.c \
src/mxt-app/buffer.h \
src/mxt-app/self_cap.c \
src/mxt-app/signal.c \
src/mxt-app/freq_sweep.c \
src/mxt-app/freq_sweep.h
run_unit_tests_CFLAGS =\
-I$(top_srcdir)/src \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections \
-Wall -Werror -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes \
-Wwrite-strings -Wshadow -Wformat-security -Wtype-limits \
-DMXT_VERSION=\"$(GIT_VERSION)\" \
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
run_unit_tests_LDFLAGS = -lcmocka -lmaxtouch -lm
TESTS = run-unit-tests
libmaxtouch_la_SOURCES =\
src/libmaxtouch/libmaxtouch.h \
src/libmaxtouch/libmaxtouch.c \
src/libmaxtouch/info_block.h \
src/libmaxtouch/info_block.c \
src/libmaxtouch/log.h \
src/libmaxtouch/log.c \
src/libmaxtouch/utilfuncs.h \
src/libmaxtouch/utilfuncs.c \
src/libmaxtouch/msg.h \
src/libmaxtouch/msg.c \
src/libmaxtouch/config.c \
src/libmaxtouch/sysfs/sysfs_device.h \
src/libmaxtouch/sysfs/sysfs_device.c \
src/libmaxtouch/debugfs/debugfs_device.h \
src/libmaxtouch/debugfs/debugfs_device.c \
src/libmaxtouch/sysfs/dmesg.h \
src/libmaxtouch/sysfs/dmesg.c \
src/libmaxtouch/i2c_dev/i2c_dev_device.h \
src/libmaxtouch/i2c_dev/i2c_dev_device.c \
src/libmaxtouch/hidraw/hidraw_device.h \
src/libmaxtouch/hidraw/hidraw_device.c
if HAVE_LIBUSB
libmaxtouch_la_SOURCES += \
src/libmaxtouch/usb/usb_device.h \
src/libmaxtouch/usb/usb_device.c
AM_CFLAGS += -DHAVE_LIBUSB
libmaxtouch_la_LIBS = @USBLIBS@
libmaxtouch_la_LDFLAGS = -lusb-1.0
endif
mxt_app_LDADD = libmaxtouch.la
EXTRA_mxt_app_DEPENDENCIES = git-version
mxt_app_SOURCES =\
src/mxt-app/mxt_app.h \
src/mxt-app/mxt_app.c \
src/mxt-app/broken_line.c \
src/mxt-app/sensor_variant.c \
src/mxt-app/polyfit.c \
src/mxt-app/menu.c \
src/mxt-app/bootloader.c \
src/mxt-app/diagnostic_data.c \
src/mxt-app/touch_app.c \
src/mxt-app/self_test.c \
src/mxt-app/bridge.c \
src/mxt-app/gr.c \
src/mxt-app/serial_data.c \
src/mxt-app/buffer.c \
src/mxt-app/buffer.h \
src/mxt-app/self_cap.c \
src/mxt-app/signal.c \
src/mxt-app/freq_sweep.c \
src/mxt-app/freq_sweep.h
.PHONY: doc
doc: doc/doxygen.cfg
doxygen doc/doxygen.cfg
if ENABLE_MAN
man1_MANS = man1/mxt-app.1
man1/mxt-app.1: README.md
@$(MKDIR_P) man1/
-pandoc -s -t man \
-V title="MXT-APP" \
-V section="1" \
-V description="\"mxt-app $(GIT_VERSION)\"" \
$(top_srcdir)/README.md -o man1/mxt-app.1
endif
clean-local:
-rm git-version
-rm man1/mxt-app.1
-rm -Rf doc/html
dist-hook:
echo $(VERSION) > $(distdir)/VERSION
indent:
astyle --style=linux --indent=spaces=2 \
$(mxt_app_SOURCES) $(libmaxtouch_la_SOURCES)
ctags:
find src -type f -name "*.[ch]" | xargs @CTAGS@