tests: proper extensions for newly added static executables

This commit is contained in:
Nguyen Anh Quynh 2014-01-09 15:49:44 +08:00
parent 625b5bcfee
commit d159a03f23
2 changed files with 5 additions and 3 deletions

1
cs.c
View File

@ -130,7 +130,6 @@ cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)
ud->arch = arch;
ud->mode = mode;
ud->big_endian = mode & CS_MODE_BIG_ENDIAN;
ud->reg_name = NULL;
// by default, do not break instruction into details
ud->detail = CS_OPT_OFF;

View File

@ -17,18 +17,21 @@ endif
LIBNAME = capstone
BIN_EXT =
AR_EXT = a
# Cygwin?
IS_CYGWIN := $(shell $(CC) -dumpmachine | grep -i cygwin | wc -l)
ifeq ($(IS_CYGWIN),1)
CFLAGS := $(CFLAGS:-fPIC=)
BIN_EXT = .exe
AR_EXT = dll.a
else
# mingw?
IS_MINGW := $(shell $(CC) --version | grep -i mingw | wc -l)
ifeq ($(IS_MINGW),1)
CFLAGS := $(CFLAGS:-fPIC=)
BIN_EXT = .exe
AR_EXT = dll.a
endif
endif
@ -41,13 +44,13 @@ BINARY = $(SOURCES:.c=$(BIN_EXT))
all: $(BINARY)
clean:
rm -rf $(OBJS) $(SOURCES:.c=) $(SOURCES:.c=.exe) lib$(LIBNAME).*
rm -rf $(OBJS) $(SOURCES:.c=) *.exe *.static lib$(LIBNAME).*
$(BINARY): $(OBJS)
%$(BIN_EXT): %.o
${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall -l$(LIBNAME) -o $@
${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall ../lib$(LIBNAME).a -o $@.static
${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall ../lib$(LIBNAME).$(AR_EXT) -o $(subst $(BIN_EXT),,$@).static$(BIN_EXT)
%.o: %.c
${CC} ${CFLAGS} -c $< -o $@