Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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