Fixed 47 missing dependencies and 51 excessive dependencies in Makefile (#1522)

* Fix Excessive and Missing Dependencies found by Vemake

* Remove extra spaces at the end of Makefile

* Remove used macro df

* Change "-rf" to "-f" in tests/Makefile

* Change "-rf" to "-f" in suite/fuzz/Makefile

* Remove 'r' from the removal command.

* Remove an extra blank line.
This commit is contained in:
Vemake 2019-07-29 14:15:05 +08:00 committed by Nguyen Anh Quynh
parent b8c7a9fb8b
commit eb357143a2
5 changed files with 12 additions and 1 deletions

View File

@ -411,7 +411,7 @@ else
endif
endif
$(LIBOBJ): config.mk *.h include/capstone/*.h
$(LIBOBJ): config.mk
$(LIBOBJ_ARM): $(DEP_ARM)
$(LIBOBJ_ARM64): $(DEP_ARM64)
@ -449,6 +449,12 @@ else
$(generate-pkgcfg)
endif
# create a list of auto dependencies
AUTODEPS:= $(patsubst %.o,%.d, $(LIBOBJ))
# include by auto dependencies
-include $(AUTODEPS)
install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY)
mkdir -p $(LIBDIR)
$(call install-library,$(LIBDIR))
@ -472,6 +478,7 @@ clean:
rm -f $(LIBOBJ)
rm -f $(BLDIR)/lib$(LIBNAME).* $(BLDIR)/$(LIBNAME).pc
rm -f $(PKGCFGF)
rm -f $(AUTODEPS)
[ ${ANDROID} -eq 1 ] && rm -rf android-ndk-*
$(MAKE) -C cstool clean

View File

@ -37,6 +37,7 @@ endif
clean:
${RM} -rf *.o $(TARGET)
${RM} -f *.d
%.o: %.c
ifeq ($(V), 0)

View File

@ -2,6 +2,7 @@
# Common functions used by Makefile & tests/Makefile
define compile
@$(CC) -MM -MP -MT $@ -MT $(@:.o=.d) $(CFLAGS) $< > $(@:.o=.d)
${CC} ${CFLAGS} -c $< -o $@
endef

View File

@ -53,6 +53,7 @@ all: $(REPRODUCERMC) $(REPRODUCERBIN) $(FUZZERBIN) $(PLATFORMDECODE)
clean:
rm -rf fuzz_harness $(OBJS) $(PLATFORMDECODE) $(REPRODUCERMC) $(REPRODUCERBIN) $(FUZZERBIN) $(OBJDIR)/lib$(LIBNAME).* $(OBJDIR)/$(LIBNAME).*
rm -f *.d $(OBJDIR)/*.d
$(REPRODUCERMC): fuzz_disasm.o drivermc.o platform.o
@mkdir -p $(@D)

View File

@ -137,6 +137,7 @@ all: $(BINARY)
clean:
rm -rf $(OBJS) $(BINARY) $(TESTDIR)/*.exe $(TESTDIR)/*.static $(OBJDIR)/lib$(LIBNAME).* $(OBJDIR)/$(LIBNAME).*
rm -f *.d $(TESTDIR)/*.d $(OBJDIR)/*.d
# remove orphan files due to renaming from test.c to test_basic.c
rm -rf $(TESTDIR)/test.o $(TESTDIR)/test.exe $(TESTDIR)/test.static $(TESTDIR)/test