Skip to content

Commit

Permalink
Variation on a theme of Makefile.docfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Mar 3, 2021
1 parent dd5455f commit ba1abce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Makefile.common
Expand Up @@ -27,8 +27,6 @@ MKDIR=mkdir -p
EMPTY :=
# $(SPACE) contains a single space
SPACE := $(EMPTY) $(EMPTY)
# $( ) allows line breaking with $\ at the end of the line
$(SPACE) :=

DESTDIR ?=
INSTALL_BINDIR := $(DESTDIR)$(BINDIR)
Expand Down
2 changes: 1 addition & 1 deletion api_docgen/Makefile
Expand Up @@ -14,8 +14,8 @@
#**************************************************************************
ROOTDIR = ..

include $(ROOTDIR)/Makefile.common
include $(ROOTDIR)/stdlib/StdlibModules
include $(ROOTDIR)/Makefile.common
include $(ROOTDIR)/Makefile.best_binaries
include $(ROOTDIR)/ocamldoc/Makefile.best_ocamldoc
include Makefile.docfiles
Expand Down
1 change: 0 additions & 1 deletion manual/tests/Makefile
@@ -1,6 +1,5 @@
TOPDIR=$(abspath ../..)
SRC=$(TOPDIR)
include $(TOPDIR)/Makefile.common
include $(TOPDIR)/stdlib/StdlibModules
include $(TOPDIR)/api_docgen/Makefile.docfiles
include $(TOPDIR)/Makefile.tools
Expand Down
9 changes: 6 additions & 3 deletions stdlib/StdlibModules
Expand Up @@ -15,7 +15,7 @@
#* *
#**************************************************************************

# Makefile.common must be included before this Makefile
# This file must be self-contained.

# This file lists all standard library modules. It is used by:
# 1. stdlib/Makefile when building stdlib.cma
Expand Down Expand Up @@ -47,12 +47,15 @@ STDLIB_MODULE_BASENAMES=\
STDLIB_PREFIXED_MODULES=\
$(filter-out stdlib camlinternal%, $(STDLIB_MODULE_BASENAMES))

define add_stdlib_prefix_first
$(shell echo $1 | cut -c1 | tr '[:lower:]' '[:upper:]')
endef

# add stdlib__ as prefix to a module except for internal modules
# and the stdlib module itself
define add_stdlib_prefix
$(or $(filter-out $(STDLIB_PREFIXED_MODULES), $1), \
stdlib__$(shell echo $1 | cut -c1 | tr '[:lower:]' '[:upper:]')$\
$(shell echo $1 | cut -c2-))
stdlib__$(call add_stdlib_prefix_first,$1)$(shell echo $1 | cut -c2-))
endef

STDLIB_MODULES:=\
Expand Down

0 comments on commit ba1abce

Please sign in to comment.