summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2019-09-11 09:16:15 +0200
committerGitHub <noreply@github.com>2019-09-11 09:16:15 +0200
commit5ec649f0cb4c9bf21f7348ae668d669f723919c7 (patch)
treed1862254dd5ab8f75b68f6ac2a132a6267c2a3ed /tools
parent24cf2f926f89f5dd5829f732dbf9be510646fa48 (diff)
downloadocaml-5ec649f0cb4c9bf21f7348ae668d669f723919c7.tar.gz
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile10
1 files changed, 7 insertions, 3 deletions
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 \