samples: clean executable binaries before building
This commit is contained in:
@ -75,7 +75,7 @@ ARCHIVE = $(LIBDIR)/lib$(LIBNAME).$(AR_EXT)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean clean_bins clean_libs
|
||||||
|
|
||||||
UNICORN_ARCHS := $(shell if [ -e ../config.log ]; then cat ../config.log;\
|
UNICORN_ARCHS := $(shell if [ -e ../config.log ]; then cat ../config.log;\
|
||||||
else printf "$(UNICORN_ARCHS)"; fi)
|
else printf "$(UNICORN_ARCHS)"; fi)
|
||||||
@ -109,13 +109,17 @@ OBJS = $(addprefix $(OBJDIR)/,$(SOURCES:.c=.o))
|
|||||||
OBJS_ELF = $(addprefix $(OBJDIR)/,$(SOURCES:.c=))
|
OBJS_ELF = $(addprefix $(OBJDIR)/,$(SOURCES:.c=))
|
||||||
BINARY = $(addprefix $(SAMPLEDIR)/,$(SOURCES:.c=$(BIN_EXT)))
|
BINARY = $(addprefix $(SAMPLEDIR)/,$(SOURCES:.c=$(BIN_EXT)))
|
||||||
|
|
||||||
all: $(BINARY)
|
all: clean_bins $(BINARY)
|
||||||
|
|
||||||
clean:
|
clean_bins:
|
||||||
rm -rf *.o $(OBJS_ELF) $(BINARY) $(SAMPLEDIR)/*.exe $(SAMPLEDIR)/*.static $(OBJDIR)/lib$(LIBNAME)* $(OBJDIR)/$(LIBNAME)*
|
rm -rf *.o $(OBJS_ELF) $(BINARY) $(SAMPLEDIR)/*.exe $(SAMPLEDIR)/*.static $(OBJDIR)/lib$(LIBNAME)* $(OBJDIR)/$(LIBNAME)*
|
||||||
rm -rf libunicorn*.so libunicorn*.lib libunicorn*.dylib unicorn*.dll unicorn*.lib
|
|
||||||
rm -rf sample_x86 sample_arm sample_arm64 sample_mips sample_sparc sample_ppc sample_m68k shellcode mem_apis
|
rm -rf sample_x86 sample_arm sample_arm64 sample_mips sample_sparc sample_ppc sample_m68k shellcode mem_apis
|
||||||
|
|
||||||
|
clean_libs:
|
||||||
|
rm -rf libunicorn*.so libunicorn*.lib libunicorn*.dylib unicorn*.dll unicorn*.lib
|
||||||
|
|
||||||
|
clean: clean_bins clean_libs
|
||||||
|
|
||||||
$(BINARY): $(OBJS)
|
$(BINARY): $(OBJS)
|
||||||
|
|
||||||
$(SAMPLEDIR)/%$(BIN_EXT): $(OBJDIR)/%.o
|
$(SAMPLEDIR)/%$(BIN_EXT): $(OBJDIR)/%.o
|
||||||
|
Reference in New Issue
Block a user