@@ -49,15 +49,18 @@ CS_ARCHIVE=https://$(CS_URL_BASE)/archive
49
49
CS_UPD =20201203
50
50
# NOTE: when you update CS_TIP or CS_BRA, also update them in shlr/meson.build
51
51
ifeq ($(USE_CSNEXT ) ,1)
52
- CS_TIP =0a29bf80017b8422c79ba51e3ad5c34ba5ee6142
53
- CS_BRA =next
52
+ # CS_TIP=0a29bf80017b8422c79ba51e3ad5c34ba5ee6142
53
+ # CS_BRA=next
54
+ CS_ROOT =../subprojects/capstone-next
54
55
else
55
56
ifeq ($(USE_CS4 ) ,1)
56
- CS_TIP =0efa3cc530ea188c0e03c945ab884ee19dd16342
57
- CS_BRA =v4
57
+ # CS_TIP=0efa3cc530ea188c0e03c945ab884ee19dd16342
58
+ # CS_BRA=v4
59
+ CS_ROOT =../subprojects/capstone-v4
58
60
else
59
- CS_TIP =8455b3c5a53b02e524494c7e72a3946a32518170
60
- CS_BRA =v5
61
+ # CS_TIP=8455b3c5a53b02e524494c7e72a3946a32518170
62
+ # CS_BRA=v5
63
+ CS_ROOT =../subprojects/capstone-v5
61
64
endif
62
65
endif
63
66
ifeq ($(CS_COMMIT_ARCHIVE ) ,1)
@@ -206,10 +209,10 @@ install-symlink symstall:
206
209
uninstall deinstall :
207
210
rm -f ${DESTDIR}${LIBDIR} /libr_shlr.${EXT_AR}
208
211
209
- .PHONY : capstone capstone-sync capstone-build capstone-clean capstone-patch capstone-pull
212
+ .PHONY : capstone capstone-sync capstone-build capstone-patch # capstone-clean capstone-pull
210
213
211
- capstone-pull :
212
- $(MAKE ) CS_RELEASE=1 WITHOUT_PULL=0 USE_CAPSTONE=0 WANT_CAPSTONE=1 capstone
214
+ # capstone-pull:
215
+ # $(MAKE) CS_RELEASE=1 WITHOUT_PULL=0 USE_CAPSTONE=0 WANT_CAPSTONE=1 capstone
213
216
214
217
ifeq ($(WANT_CAPSTONE ) ,0)
215
218
capstone :
@@ -229,47 +232,47 @@ capstone-build:
229
232
else
230
233
231
234
ifeq ($(CS_RELEASE ) ,1)
232
- capstone-sync : capstone
235
+ # capstone-sync: capstone
233
236
234
- capstone-clean :
235
- -$(MAKE ) -C capstone clean
237
+ # capstone-clean:
238
+ # -$(MAKE) -C capstone clean
236
239
237
- capstone : capstone-$(CS_VER ) .tar.gz
238
- tar xzvf capstone-$(CS_VER ) .tar.gz
239
- rm -rf capstone
240
- mv capstone-$(CS_VER ) capstone
240
+ capstone : # capstone-$(CS_VER).tar.gz
241
241
$(MAKE ) patch-capstone
242
+ # tar xzvf capstone-$(CS_VER).tar.gz
243
+ # rm -rf capstone
244
+ # mv capstone-$(CS_VER) capstone
242
245
243
246
# already implemented in capstone.sh
244
247
patch-capstone capstone-patch :
245
248
ifeq ($(CS_PATCHES ) ,1)
246
- if [ -d capstone -a -d capstone /.git ]; then \
249
+ if [ -d $(CS_ROOT) -a -d $(CS_ROOT) /.git ]; then \
247
250
ifeq ($(USE_CS4 ) ,1)
248
- cd capstone && for PATCH in ../capstone-patches/v4/* ; do patch -p1 < $$PATCH ; done ; \
251
+ cd $(CS_ROOT) && for PATCH in ../capstone-patches/v4/* ; do patch -p1 < $$PATCH ; done ; \
249
252
else
250
- cd capstone && for PATCH in ../capstone-patches/v5/* ; do patch -p1 < $$PATCH ; done ; \
253
+ cd $(CS_ROOT) && for PATCH in ../capstone-patches/v5/* ; do patch -p1 < $$PATCH ; done ; \
251
254
endif
252
255
fi
253
256
endif
254
- mkdir -p capstone /include/capstone
255
- cp -rf capstone /include/*.h capstone /include/capstone
257
+ mkdir -p $(CS_ROOT) /include/capstone
258
+ cp -rf $(CS_ROOT) /include/*.h $(CS_ROOT) /include/capstone
256
259
257
- capstone-$(CS_VER ) .tar.gz :
258
- $(WGET ) capstone-$(CS_VER ) .tar.gz $(CS_TAR )
259
- else
260
+ # capstone-$(CS_VER).tar.gz:
261
+ # $(WGET) capstone-$(CS_VER).tar.gz $(CS_TAR)
262
+ # else
260
263
261
- capstone : capstone-sync
264
+ # capstone: capstone-sync
262
265
263
266
patch-capstone capstone-patch :
264
267
265
- capstone-sync :
266
- ifeq ($(WITHOUT_PULL ) ,1)
267
- @echo "Nothing to sync because of --without-pull"
268
- else
269
- if [ ! -d capstone ] || [ ! -f capstone/libcapstone.a ] || [ $(shell [ -d capstone/.git ] && git --git-dir capstone/.git rev-parse HEAD) != $(CS_TIP) ]; then \
270
- "$(SHELL)" capstone.sh "${CS_URL}" "${CS_BRA}" "${CS_TIP}" "${CS_REV}" "${CS_ARCHIVE_URL}" ; \
271
- fi
272
- endif
268
+ # capstone-sync:
269
+ # ifeq ($(WITHOUT_PULL),1)
270
+ # @echo "Nothing to sync because of --without-pull"
271
+ # else
272
+ # if [ ! -d capstone ] || [ ! -f capstone/libcapstone.a ] || [ $(shell [ -d capstone/.git ] && git --git-dir capstone/.git rev-parse HEAD) != $(CS_TIP) ]; then \
273
+ # "$(SHELL)" capstone.sh "${CS_URL}" "${CS_BRA}" "${CS_TIP}" "${CS_REV}" "${CS_ARCHIVE_URL}" ; \
274
+ # fi
275
+ # endif
273
276
274
277
.PHONY : capstone capstone-sync
275
278
endif
@@ -282,11 +285,11 @@ endif
282
285
283
286
capstone-build : capstone
284
287
ifeq ($(CAPSTONE_LDFLAGS ) ,)
285
- cd capstone && CFLAGS="${CAPSTONE_CFLAGS} $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
288
+ cd $(CS_ROOT) && CFLAGS="${CAPSTONE_CFLAGS} $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
286
289
$(MAKE) $(CAPSTONE_MAKEFLAGS) CC="$(CC)" AR_EXT=a IS_CYGWIN=0 CAPSTONE_STATIC=yes CAPSTONE_SHARED=no \
287
290
RANLIB="$(RANLIB)" LIBARCHS="" AR="$(AR)" IS_MINGW=0 libcapstone.a
288
291
ifneq (${EXT_AR},a)
289
- -cp -f capstone /libcapstone.a capstone /libcapstone.${EXT_AR}
292
+ -cp -f $(CS_ROOT) /libcapstone.a $(CS_ROOT) /libcapstone.${EXT_AR}
290
293
endif
291
294
else
292
295
echo "Using capstone from system"
@@ -296,7 +299,7 @@ endif
296
299
endif
297
300
298
301
headsup :
299
- [ " ` cd capstone && git rev-parse HEAD` " = " $( CS_TIP) " ]
302
+ [ " ` cd $( CS_ROOT ) && git rev-parse HEAD` " = " $( CS_TIP) " ]
300
303
301
304
../../radare2-webui :
302
305
cd ../.. ; git clone --depth 1 https://github.com/radareorg/radare2-webui
@@ -342,7 +345,7 @@ spp: spp-sync
342
345
343
346
SHLRS+ =ar/libr_ar.a
344
347
SHLRS+ =bochs/lib/libbochs.a
345
- SHLRS+ =capstone /libcapstone.a
348
+ SHLRS+ =$( CS_ROOT ) /libcapstone.a
346
349
SHLRS+ =gdb/lib/libgdbr.a
347
350
SHLRS+ =grub/libgrubfs.a
348
351
SHLRS+ =java/libr_java.a
0 commit comments