All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Makefile: clean up and simplify
@ 2017-07-17  2:02 Christopher Li
  0 siblings, 0 replies; only message in thread
From: Christopher Li @ 2017-07-17  2:02 UTC (permalink / raw)
  To: Linux-Sparse, Luc Van Oostenryck

- For invoke shell command, use immediate evaluation to avoid
  invoke more than once.
- Adding header file dependency to all object files. Remove the
  hand specify header file dependency.
- Change c2xml to target specific CFLAGS, this allow c2xml using
  the common pattern rules.

Signed-of-By: Christopher Li <sparse@chrisli.org>
---
 Makefile | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 4d5df1a..0706d8d 100644
--- a/Makefile
+++ b/Makefile
@@ -34,10 +34,10 @@ HAVE_GTK2:=$(shell $(PKG_CONFIG) --exists gtk+-2.0
2>/dev/null && echo 'yes')
 LLVM_CONFIG:=llvm-config
 HAVE_LLVM:=$(shell $(LLVM_CONFIG) --version >/dev/null 2>&1 && echo 'yes')

-GCC_BASE = $(shell $(CC) --print-file-name=)
+GCC_BASE := $(shell $(CC) --print-file-name=)
 BASIC_CFLAGS = -DGCC_BASE=\"$(GCC_BASE)\"

-MULTIARCH_TRIPLET = $(shell $(CC) -print-multiarch 2>/dev/null)
+MULTIARCH_TRIPLET := $(shell $(CC) -print-multiarch 2>/dev/null)
 BASIC_CFLAGS += -DMULTIARCH_TRIPLET=\"$(MULTIARCH_TRIPLET)\"

 ifeq ($(HAVE_GCC_DEP),yes)
@@ -187,17 +187,15 @@ $(SLIB_FILE): $(LIB_OBJS)
  $(QUIET_LINK)$(CC) $(LDFLAGS) -Wl,-soname,$@ -shared -o $@ $(LIB_OBJS)

 DEP_FILES := $(wildcard .*.o.d)
-$(if $(DEP_FILES),$(eval include $(DEP_FILES)))

-c2xml.o: c2xml.c $(LIB_H)
- $(QUIET_CC)$(CC) `$(PKG_CONFIG) --cflags libxml-2.0` -o $@ -c $(ALL_CFLAGS) $<
+ifneq ($(DEP_FILES),)
+include $(DEP_FILES)
+endif

-compat-linux.o: compat/strtold.c compat/mmap-blob.c $(LIB_H)
-compat-solaris.o: compat/mmap-blob.c $(LIB_H)
-compat-mingw.o: $(LIB_H)
-compat-cygwin.o: $(LIB_H)
+LIBXML_CFLAGS := $(shell $(PKG_CONFIG) --cflags libxml-2.0)
+c2xml.o: CFLAGS += $(LIBXML_CFLAGS)

-%.o: %.c
+%.o: %.c $(LIB_H)
  $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

 clean: clean-check
-- 
2.9.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-17  2:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17  2:02 [PATCH 1/3] Makefile: clean up and simplify Christopher Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.