Skip to content

Commit

Permalink
Make private build variables private
Browse files Browse the repository at this point in the history
Given the convention that the OC_* build varialbes are reserved for
the build system, it seems better to make sure all of them are defined
in the private Makefile.build_config file, rather than in Makefile.config
which gets installed and thus becomes public.

This commit moves the definitions of OC_CFLAGS, OC_CPPFLAGS,
OC_LDFLAGS, OC_DLL_LDFLAGS and OC_EXE_LDFLAGS from Makefile.config.in to
Makefile.build_config.in. It also moves the defintion of MKEXE_VIA_CC,
since this variable relies on private build varables and does not seem
relevant or useful outside of the context of the build of the compiler itself.
  • Loading branch information
shindere committed Mar 14, 2023
1 parent b72b639 commit 48fa4b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 14 additions & 0 deletions Makefile.build_config.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ INSTALL_OCAMLNAT = @install_ocamlnat@
DEP_CC=@DEP_CC@ -MM
COMPUTE_DEPS=@compute_deps@

# Build-system flags to use to compile C files
OC_CFLAGS=@oc_cflags@
OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@

# Additional link-time options
# To support dynamic loading of shared libraries (they need to look at
# our own symbols):
OC_LDFLAGS=@oc_ldflags@
OC_DLL_LDFLAGS=@oc_dll_ldflags@
OC_EXE_LDFLAGS=@oc_exe_ldflags@

MKEXE_VIA_CC=\
$(CC) $(OC_EXE_LDFLAGS) $(OC_CFLAGS) $(CFLAGS) @mkexe_via_cc_ldflags@

# Which tool to use to display differences between files
DIFF=@DIFF@
# Which flags to pass to the diff tool
Expand Down
11 changes: 0 additions & 11 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ CC=@CC@
CC_HAS_DEBUG_PREFIX_MAP=@cc_has_debug_prefix_map@
AS_HAS_DEBUG_PREFIX_MAP=@as_has_debug_prefix_map@

### Additional link-time options
# To support dynamic loading of shared libraries (they need to look at
# our own symbols):
OC_LDFLAGS=@oc_ldflags@
OC_DLL_LDFLAGS=@oc_dll_ldflags@
OC_EXE_LDFLAGS=@oc_exe_ldflags@

LDFLAGS?=@LDFLAGS@

### How to invoke the C preprocessor through the C compiler
Expand Down Expand Up @@ -175,9 +168,7 @@ OTHERLIBRARIES=@otherlibraries@
UNIX_OR_WIN32=@unix_or_win32@
INSTALL_SOURCE_ARTIFACTS=@install_source_artifacts@

OC_CFLAGS=@oc_cflags@
CFLAGS=@CFLAGS@
OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@
CPPFLAGS=@CPPFLAGS@
OCAMLC_CFLAGS=@ocamlc_cflags@

Expand Down Expand Up @@ -214,8 +205,6 @@ MKEXE=@mkexe@
MKDLL=@mkdll@
MKMAINDLL=@mkmaindll@
MKEXEDEBUGFLAG=@mkexedebugflag@
MKEXE_VIA_CC=\
$(CC) $(OC_EXE_LDFLAGS) $(OC_CFLAGS) $(CFLAGS) @mkexe_via_cc_ldflags@

RUNTIMED=@debug_runtime@
INSTRUMENTED_RUNTIME=@instrumented_runtime@
Expand Down

0 comments on commit 48fa4b7

Please sign in to comment.