Makefile: do not regenerate diet.h if it is existent - patched by Pancake. this also deletes diet.h for clean target
diff --git a/Makefile b/Makefile
index 5dfb96c..0da5a1a 100644
--- a/Makefile
+++ b/Makefile
@@ -135,7 +135,7 @@
VERSION=$(shell echo `grep -e PKG_MAJOR -e PKG_MINOR CONFIG | grep -v = | awk '{print $$3}'` | awk '{print $$1"."$$2}')
-.PHONY: all clean install uninstall diet dist
+.PHONY: all clean install uninstall dist
all: $(LIBRARY) $(ARCHIVE) $(PKGCFGF)
$(MAKE) -C tests
@@ -144,15 +144,15 @@
$(LIBRARY): $(LIBOBJ)
$(CC) $(LDFLAGS) $(LIBOBJ) -o $(LIBRARY)
-$(LIBOBJ): diet
+$(LIBOBJ): include/diet.h
-# generate include/diet.h
-diet:
+# auto-generate include/diet.h
+include/diet.h:
@echo "// File auto-generated by Makefile for Capstone framework. DO NOT MODIFY!" > include/diet.h
+ @echo "" >> include/diet.h
@echo "#ifndef CAPSTONE_DIET_H" >> include/diet.h
@echo "#define CAPSTONE_DIET_H" >> include/diet.h
@echo "" >> include/diet.h
- @echo "" >> include/diet.h
ifneq (,$(findstring yes,$(CAPSTONE_DIET)))
@echo "// Capstone is in DIET mode" >> include/diet.h
@echo "#define CAPSTONE_DIET" >> include/diet.h
@@ -196,6 +196,7 @@
clean:
rm -f $(LIBOBJ) lib$(LIBNAME).*
rm -f $(PKGCFGF)
+ rm -f include/diet.h
$(MAKE) -C bindings/python clean
$(MAKE) -C bindings/java clean
$(MAKE) -C bindings/ocaml clean