Skip to content

Commit

Permalink
Merge pull request capstone-engine#763 from akihikodaki/check
Browse files Browse the repository at this point in the history
Fix check target for Unix-like environment
  • Loading branch information
aquynh authored Sep 7, 2016
2 parents 3c07b94 + 798821f commit 5c04e4c
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ ifndef BUILDDIR
else
cd tests && $(MAKE) BUILDDIR=$(BLDIR)
endif
ifeq ($(CAPSTONE_SHARED),yes)
$(INSTALL_DATA) $(LIBRARY) $(BLDIR)/tests/
endif
$(call install-library,$(BLDIR)/tests/)
endif

ifeq ($(CAPSTONE_SHARED),yes)
Expand Down Expand Up @@ -378,14 +376,7 @@ endif

install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY)
mkdir -p $(LIBDIR)
ifeq ($(CAPSTONE_SHARED),yes)
$(INSTALL_LIB) $(LIBRARY) $(LIBDIR)
ifneq ($(VERSION_EXT),)
cd $(LIBDIR) && \
mv lib$(LIBNAME).$(EXT) lib$(LIBNAME).$(VERSION_EXT) && \
ln -s lib$(LIBNAME).$(VERSION_EXT) lib$(LIBNAME).$(EXT)
endif
endif
$(call install-library,$(LIBDIR))
ifeq ($(CAPSTONE_STATIC),yes)
$(INSTALL_DATA) $(ARCHIVE) $(LIBDIR)
endif
Expand Down Expand Up @@ -441,7 +432,7 @@ TESTS += test_skipdata test_skipdata.static test_iter.static
check:
@for t in $(TESTS); do \
echo Check $$t ... ; \
./tests/$$t > /dev/null && echo OK || echo FAILED; \
LD_LIBRARY_PATH=./tests ./tests/$$t > /dev/null && echo OK || echo FAILED; \
done

$(OBJDIR)/%.o: %.c
Expand All @@ -454,6 +445,20 @@ else
endif


ifeq ($(CAPSTONE_SHARED),yes)
define install-library
$(INSTALL_LIB) $(LIBRARY) $1
$(if $(VERSION_EXT),
cd $1 && \
mv lib$(LIBNAME).$(EXT) lib$(LIBNAME).$(VERSION_EXT) && \
ln -s lib$(LIBNAME).$(VERSION_EXT) lib$(LIBNAME).$(EXT))
endef
else
define install-library
endef
endif


define create-archive
$(AR) q $(ARCHIVE) $(LIBOBJ)
$(RANLIB) $(ARCHIVE)
Expand Down

0 comments on commit 5c04e4c

Please sign in to comment.