From 0936b56c54e3f0cb58790df3b9d9fa13cbdf7dd6 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Wed, 4 Jun 2014 00:26:33 +0800 Subject: [PATCH] rename libcapstone.dll to capstone.dll, libcapstone.lib to capstone.lib for Windows platform --- Makefile | 22 ++++++++++++++++++---- tests/Makefile | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 628f37b5..08d3fe9d 100644 --- a/Makefile +++ b/Makefile @@ -275,11 +275,25 @@ endif endif ifeq ($(CAPSTONE_SHARED),yes) +ifeq ($(IS_MINGW),1) +LIBRARY = $(BLDIR)/$(LIBNAME).$(EXT) +else ifeq ($(IS_CYGWIN),1) +LIBRARY = $(BLDIR)/$(LIBNAME).$(EXT) +else # *nix LIBRARY = $(BLDIR)/lib$(LIBNAME).$(EXT) endif +endif + ifeq ($(CAPSTONE_STATIC),yes) +ifeq ($(IS_MINGW),1) +ARCHIVE = $(BLDIR)/$(LIBNAME).$(AR_EXT) +else ifeq ($(IS_CYGWIN),1) +ARCHIVE = $(BLDIR)/$(LIBNAME).$(AR_EXT) +else ARCHIVE = $(BLDIR)/lib$(LIBNAME).$(AR_EXT) endif +endif + PKGCFGF = $(BLDIR)/$(LIBNAME).pc .PHONY: all clean install uninstall dist @@ -291,7 +305,7 @@ else cd tests && $(MAKE) BUILDDIR=$(BLDIR) endif ifeq ($(CAPSTONE_SHARED),yes) - $(INSTALL_DATA) $(BLDIR)/lib$(LIBNAME).$(EXT) $(BLDIR)/tests/ + $(INSTALL_DATA) $(LIBRARY) $(BLDIR)/tests/ endif ifeq ($(CAPSTONE_SHARED),yes) @@ -339,7 +353,7 @@ install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY) ifeq ($(CAPSTONE_SHARED),yes) # remove potential broken old libs rm -f $(LIBDIR)/lib$(LIBNAME).* - $(INSTALL_LIB) $(BLDIR)/lib$(LIBNAME).$(EXT) $(LIBDIR) + $(INSTALL_LIB) $(LIBRARY) $(LIBDIR) ifneq ($(VERSION_EXT),) cd $(LIBDIR) && \ mv lib$(LIBNAME).$(EXT) lib$(LIBNAME).$(VERSION_EXT) && \ @@ -347,7 +361,7 @@ ifneq ($(VERSION_EXT),) endif endif ifeq ($(CAPSTONE_STATIC),yes) - $(INSTALL_DATA) $(BLDIR)/lib$(LIBNAME).$(AR_EXT) $(LIBDIR) + $(INSTALL_DATA) $(ARCHIVE) $(LIBDIR) endif mkdir -p $(INCDIR)/$(LIBNAME) $(INSTALL_DATA) include/*.h $(INCDIR)/$(LIBNAME) @@ -361,7 +375,7 @@ uninstall: clean: rm -f $(LIBOBJ) - rm -f $(BLDIR)/lib$(LIBNAME).* + rm -f $(BLDIR)/lib$(LIBNAME).* $(BLDIR)/$(LIBNAME).* rm -f $(PKGCFGF) cd tests && $(MAKE) clean rm -f $(BLDIR)/tests/lib$(LIBNAME).$(EXT) diff --git a/tests/Makefile b/tests/Makefile index 53c4ccaa..3c307bc7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -49,6 +49,16 @@ AR_EXT = lib endif endif +ifeq ($(CAPSTONE_STATIC),yes) +ifeq ($(IS_MINGW),1) +ARCHIVE = $(LIBDIR)/$(LIBNAME).$(AR_EXT) +else ifeq ($(IS_CYGWIN),1) +ARCHIVE = $(LIBDIR)/$(LIBNAME).$(AR_EXT) +else +ARCHIVE = $(LIBDIR)/lib$(LIBNAME).$(AR_EXT) +endif +endif + .PHONY: all clean SOURCES = test.c test_detail.c test_skipdata.c @@ -83,7 +93,7 @@ BINARY = $(addprefix $(TESTDIR)/,$(SOURCES:.c=$(BIN_EXT))) all: $(BINARY) clean: - rm -rf $(OBJS) $(BINARY) $(TESTDIR)/*.exe $(TESTDIR)/*.static $(OBJDIR)/lib$(LIBNAME).* + rm -rf $(OBJS) $(BINARY) $(TESTDIR)/*.exe $(TESTDIR)/*.static $(OBJDIR)/lib$(LIBNAME).* $(OBJDIR)/$(LIBNAME).* $(BINARY): $(OBJS) @@ -123,7 +133,7 @@ endef define link-static - ${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall $(LIBDIR)/lib$(LIBNAME).$(AR_EXT) -o $(call staticname,$@) + ${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall $(ARCHIVE) -o $(call staticname,$@) endef