From 5ec649f0cb4c9bf21f7348ae668d669f723919c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Wed, 11 Sep 2019 09:16:15 +0200 Subject: Build system: share rules to compile C files (#8930) This commit deduplicates some of the Makefile rules used to compile C files. Rather than having one such rule per Makefile for each directory containing C files, the relevant rules are moved to Makefile.common.in. --- tools/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/Makefile b/tools/Makefile index 0fcc9b674f..e4c28bc268 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -267,9 +267,13 @@ else DEF_SYMBOL_PREFIX = '-Dsymbol_prefix=""' endif -objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h - $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \ - $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK) +objinfo_helper$(EXE): objinfo_helper.$(O) + $(CC) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(LIBBFD_LINK) + +objinfo_helper.$(O): $(ROOTDIR)/runtime/caml/s.h + +objinfo_helper.$(O): \ + OC_CPPFLAGS += -I$(ROOTDIR)/runtime $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \ $(ROOTDIR)/compilerlibs/ocamlbytecomp.cma \ -- cgit v1.2.1