From 5bbbfcec160a3660fdbf55106646815161830fcf Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Fri, 28 Feb 2014 10:49:46 +0800 Subject: [PATCH] Makefile: do not regenerate diet.h if it is existent - patched by Pancake. this also deletes diet.h for clean target --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5dfb96c6..0da5a1ae 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ PKGCFGF = $(LIBNAME).pc 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 @@ all: $(LIBRARY) $(ARCHIVE) $(PKGCFGF) $(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 @@ uninstall: 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