Skip to content

Commit

Permalink
tests: proper extensions for newly added static executables
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jan 9, 2014
1 parent 625b5bc commit d159a03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 5 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 $@

0 comments on commit d159a03

Please sign in to comment.