Skip to content

Commit

Permalink
Fixed 47 missing dependencies and 51 excessive dependencies in Makefi…
Browse files Browse the repository at this point in the history
…le (capstone-engine#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.
  • Loading branch information
vemakereporter authored and aquynh committed Jul 29, 2019
1 parent f931eef commit b78a640
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions cstool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ endif

clean:
${RM} -rf *.o $(TARGET)
${RM} -f *.d

%.o: %.c
ifeq ($(V), 0)
Expand Down
1 change: 1 addition & 0 deletions functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions suite/fuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b78a640

Please sign in to comment.