-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
214 lines (184 loc) · 4.74 KB
/
Copy pathMakefile
File metadata and controls
214 lines (184 loc) · 4.74 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
ifeq ($(PLATFORM),EMBEDDED)
ENDIANNESS = BIG
include ../arch/ARM/ixp42x/module.mk
STRIP ?= $(TOOLS_PATH)/strip
else
STRIP ?= strip
endif
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
LTKC_LIB_DIR = lib/LTK/LTKC/Library
LTK_INC_DIR = $(LTKC_LIB_DIR)
LTK_TM_INC_DIR = $(LTKC_LIB_DIR)/LLRP.org
#LLRP = $(LTKC_LIB_DIR)/*.o $(LTKC_LIB_DIR)/LLRP.org/*.o
endif
STATIC_LIB = libmercuryapi.a
SHARED_LIB = libmercuryapi.so.1
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
LTKC_LIB = $(LTKC_LIB_DIR)/libltkc.a
LTKC_TM_LIB = $(LTKC_LIB_DIR)/LLRP.org/libltkctm.a
LTKC_LIBS = $(LTKC_LIB) $(LTKC_TM_LIB)
endif
OBJS += serial_transport_posix.o
OBJS += serial_transport_tcp_posix.o
#OBJS += serial_transport_llrp.o
OBJS += tmr_strerror.o
OBJS += tmr_param.o
OBJS += hex_bytes.o
OBJS += tm_reader.o
OBJS += tm_reader_async.o
OBJS += serial_reader.o
OBJS += tmr_loadsave_configuration.o
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
OBJS += llrp_reader.o
OBJS += llrp_reader_l3.o
endif
OBJS += serial_reader_l3.o
OBJS += tmr_utils.o
OBJS += osdep_posix.o
HEADERS += serial_reader_imp.h
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
HEADERS += llrp_reader_imp.h
HEADERS += tmr_llrp_reader.h
endif
HEADERS += tm_config.h
HEADERS += tm_reader.h
HEADERS += tmr_filter.h
HEADERS += tmr_gen2.h
HEADERS += tmr_gpio.h
HEADERS += tmr_ipx.h
HEADERS += tmr_iso180006b.h
HEADERS += tmr_params.h
HEADERS += tmr_read_plan.h
HEADERS += tmr_region.h
HEADERS += tmr_serial_reader.h
HEADERS += tmr_serial_transport.h
HEADERS += tmr_status.h
HEADERS += tmr_tag_auth.h
HEADERS += tmr_tag_data.h
HEADERS += tmr_tag_lock_action.h
HEADERS += tmr_tag_protocol.h
HEADERS += tmr_tagop.h
HEADERS += tmr_types.h
HEADERS += tmr_utils.h
DBG ?= -g
CWARN = -Werror -Wall
# Add -Wextra to chase down warnings that might appear on build server, but not dev machines
#CWARN += -Wextra
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
CFLAGS += -I$(LTK_INC_DIR) -I$(LTK_TM_INC_DIR)
else
CFLAGS += -D TMR_ENABLE_SERIAL_READER_ONLY=1
endif
CFLAGS += -I. $(DBG) $(CWARN)
# Position-independent code required for shared libraries
CFLAGS += -fPIC
ifndef SKIP_SAMPLES
ifneq ($(PLATFORM),EMBEDDED)
PROGS += demo
endif
PROGS += filter
PROGS += firmwareload
PROGS += locktag
PROGS += multireadasync
PROGS += read
PROGS += readasync
PROGS += readintoarray
PROGS += blockpermalock
PROGS += blockwrite
PROGS += embeddedreadtid
PROGS += licensekey
PROGS += multiprotocolread
PROGS += savedconfig
PROGS += writetag
PROGS += readasynctrack
PROGS += readasyncfilter
PROGS += readasyncfilter-ISO18k-6b
PROGS += serialtime
PROGS += tagdir
PROGS += fastid
PROGS += denatranIAVcustomtagoperations
PROGS += readerstats
PROGS += readerInfo
PROGS += antennalist
PROGS += securereaddata
PROGS += readstopTrigger
PROGS += rebootReader
PROGS += readasyncGPIOControl
PROGS += readcustomtransport
PROGS += savedreadplanconfig
PROGS += loadsaveconfiguration
PROGS += bap
PROGS += readallmembanks-GEN2
PROGS += gpiocommands
PROGS += SL900Agetcalibrationdata
PROGS += SL900Agetsensorvalue
PROGS += SL900Asetcalibrationdata
PROGS += SL900Asetsfeparameters
PROGS += authenticate
PROGS += readbuffer
PROGS += untraceable
PROGS += autonomousmode
endif
ifneq ($(TMR_ENABLE_SERIAL_READER_ONLY), 1)
all: $(LTKC_LIB) $(STATIC_LIB) $(SHARED_LIB) $(PROGS)
$(OBJS): $(LTKC_LIB) $(LTKC_TM_IB)
$(LTKC_LIB) $(LTKC_TM_LIB): lib/LTK
lib/LTK: lib/install_LTKC.sh
SOURCE_DIR=lib PATCH_DIR=lib XML_DIR=lib sh $< NULL lib
cd $(LTKC_LIB_DIR); make CC="$(CC) $(CFLAGS)" STRIP="$(STRIP)"
else
all: $(STATIC_LIB) $(SHARED_LIB) $(PROGS)
$(OBJS):
endif
$(SHARED_LIB): $(OBJS)
$(CC) $(CFLAGS) -shared -Wl,-rpath,/tm/lib,-soname,libmercuryapi.so.1 -o $@ $^ $(OPTOBJS) -lpthread
$(STATIC_LIB): $(OBJS)
ar -rc $@ $^ $(OPTOBJS)
LIB = $(STATIC_LIB)
ifdef SHARED
ifneq (0,$(SHARED))
LIB = $(SHARED_LIB)
endif
endif
ifndef SKIP_SAMPLES
include samples.mk
endif
.PHONY: clean
clean:
rm -f $(STATIC_LIB) $(SHARED_LIB) $(PROGS) *.o ../samples/*.o core tests/*.output
rm -fr lib/LTK
.PHONY: test
TESTSCRIPTS ?=
test: demo
tests/runtests.sh $(TESTSCRIPTS)
longtest: demo
while [ 1 ]; do echo Iteration: `date`; make test; done
test-sleeprecovery: demo
./demo -v $(URI) <tests/test-sleeprecovery.prelim-script
# @todo Turn sleeprecovery into a real script when we know what to put in the key file
# What serial ports exist?
list-linux-ports:
echo /dev/tty{ACM,USB,S}*
## Measure library size
libsize: $(LIB) $(LIB).stripped
svn di tm_config.h
echo DBG: $(DBG)
ls -l $<*
echo
%.stripped: %
cp -p $< $@
strip $@
## Test of minimum library size
empty.c:
echo >$@
libempty.a: empty.o
ar -rc $@ $^
libemptysize: libempty.a libempty.a.stripped
ls -l $<*
echo
# For internal use only. Distribution should already include the following target files.
lib/install_LTKC.sh:
make -f externals.mk
ifdef EXTRAMKS
include $(EXTRAMKS)
endif