Skip to content

Commit 6b5e343

Browse files
committed
Attempt for Make
1 parent 716efc4 commit 6b5e343

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

shlr/Makefile

+40-37
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,18 @@ CS_ARCHIVE=https://$(CS_URL_BASE)/archive
4949
CS_UPD=20201203
5050
# NOTE: when you update CS_TIP or CS_BRA, also update them in shlr/meson.build
5151
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
5455
else
5556
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
5860
else
59-
CS_TIP=8455b3c5a53b02e524494c7e72a3946a32518170
60-
CS_BRA=v5
61+
# CS_TIP=8455b3c5a53b02e524494c7e72a3946a32518170
62+
# CS_BRA=v5
63+
CS_ROOT=../subprojects/capstone-v5
6164
endif
6265
endif
6366
ifeq ($(CS_COMMIT_ARCHIVE),1)
@@ -206,10 +209,10 @@ install-symlink symstall:
206209
uninstall deinstall:
207210
rm -f ${DESTDIR}${LIBDIR}/libr_shlr.${EXT_AR}
208211

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
210213

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
213216

214217
ifeq ($(WANT_CAPSTONE),0)
215218
capstone:
@@ -229,47 +232,47 @@ capstone-build:
229232
else
230233

231234
ifeq ($(CS_RELEASE),1)
232-
capstone-sync: capstone
235+
# capstone-sync: capstone
233236

234-
capstone-clean:
235-
-$(MAKE) -C capstone clean
237+
# capstone-clean:
238+
# -$(MAKE) -C capstone clean
236239

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
241241
$(MAKE) patch-capstone
242+
# tar xzvf capstone-$(CS_VER).tar.gz
243+
# rm -rf capstone
244+
# mv capstone-$(CS_VER) capstone
242245

243246
# already implemented in capstone.sh
244247
patch-capstone capstone-patch:
245248
ifeq ($(CS_PATCHES),1)
246-
if [ -d capstone -a -d capstone/.git ]; then \
249+
if [ -d $(CS_ROOT) -a -d $(CS_ROOT)/.git ]; then \
247250
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 ; \
249252
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 ; \
251254
endif
252255
fi
253256
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
256259

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
260263

261-
capstone: capstone-sync
264+
# capstone: capstone-sync
262265

263266
patch-capstone capstone-patch:
264267

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
273276

274277
.PHONY: capstone capstone-sync
275278
endif
@@ -282,11 +285,11 @@ endif
282285

283286
capstone-build: capstone
284287
ifeq ($(CAPSTONE_LDFLAGS),)
285-
cd capstone && CFLAGS="${CAPSTONE_CFLAGS} $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
288+
cd $(CS_ROOT) && CFLAGS="${CAPSTONE_CFLAGS} $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
286289
$(MAKE) $(CAPSTONE_MAKEFLAGS) CC="$(CC)" AR_EXT=a IS_CYGWIN=0 CAPSTONE_STATIC=yes CAPSTONE_SHARED=no \
287290
RANLIB="$(RANLIB)" LIBARCHS="" AR="$(AR)" IS_MINGW=0 libcapstone.a
288291
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}
290293
endif
291294
else
292295
echo "Using capstone from system"
@@ -296,7 +299,7 @@ endif
296299
endif
297300

298301
headsup:
299-
[ "`cd capstone && git rev-parse HEAD`" = "$(CS_TIP)" ]
302+
[ "`cd $(CS_ROOT) && git rev-parse HEAD`" = "$(CS_TIP)" ]
300303

301304
../../radare2-webui:
302305
cd ../.. ; git clone --depth 1 https://github.com/radareorg/radare2-webui
@@ -342,7 +345,7 @@ spp: spp-sync
342345

343346
SHLRS+=ar/libr_ar.a
344347
SHLRS+=bochs/lib/libbochs.a
345-
SHLRS+=capstone/libcapstone.a
348+
SHLRS+=$(CS_ROOT)/libcapstone.a
346349
SHLRS+=gdb/lib/libgdbr.a
347350
SHLRS+=grub/libgrubfs.a
348351
SHLRS+=java/libr_java.a

0 commit comments

Comments
 (0)