Skip to content

Commit

Permalink
Various cleanups and simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
shindere committed Oct 30, 2021
1 parent 0535d45 commit 26217ca
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 39 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ endif
$(INSTALL_DATA) \
$(BYTESTART) $(TOPLEVELSTART) \
"$(INSTALL_COMPLIBDIR)"
$(INSTALL_DATA) \
toplevel/topdirs.cmi \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) toplevel/topdirs.cmi "$(INSTALL_LIBDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
toplevel/topdirs.cmt \
Expand Down
19 changes: 10 additions & 9 deletions ocamldoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ DEPFLAGS = -slash
# For installation
##############

CP=cp
programs := ocamldoc ocamldoc.opt
include Makefile.best_ocamldoc

Expand All @@ -52,6 +51,8 @@ else
GENERATORS_CMXS =
endif

INSTALL_OCDOCDIR = $(INSTALL_LIBDIR)/ocamldoc

# Compilation
#############

Expand Down Expand Up @@ -227,18 +228,18 @@ DEPEND_PREREQS = $(LEXERS:.mll=.ml) \
.PHONY: install
install:
$(MKDIR) "$(INSTALL_BINDIR)"
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc"
$(MKDIR) "$(INSTALL_OCDOCDIR)"
$(INSTALL_PROG) $(OCAMLDOC) "$(INSTALL_BINDIR)"
$(INSTALL_DATA) \
ocamldoc.hva *.cmi $(OCAMLDOC_LIBCMA) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"
$(INSTALL_DATA) \
$(OCAMLDOC_LIBCMIS) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"
endif

# Note: at the moment, $(INSTALL_MANODIR) is created even if the doc has
Expand All @@ -251,19 +252,19 @@ installopt:
.PHONY: installopt_really
installopt_really:
$(MKDIR) "$(INSTALL_BINDIR)"
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc"
$(MKDIR) "$(INSTALL_OCDOCDIR)"
$(INSTALL_PROG) $(OCAMLDOC_OPT) "$(INSTALL_BINDIR)"
$(INSTALL_DATA) \
$(OCAMLDOC_LIBCMIS) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"
endif
$(INSTALL_DATA) \
ocamldoc.hva *.cmx $(OCAMLDOC_LIBA) $(OCAMLDOC_LIBCMXA) \
"$(INSTALL_LIBDIR)/ocamldoc"
"$(INSTALL_OCDOCDIR)"

# TODO: also split into several rules

Expand Down
8 changes: 2 additions & 6 deletions otherlibs/dynlink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,9 @@ $(extract_crc): dynlink.cma byte/dynlink_compilerlibs.cmo extract_crc.cmo
$(OCAMLC) -o $@ $^

install:
$(INSTALL_DATA) \
dynlink.cmi dynlink.cma \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) dynlink.cmi dynlink.cma "$(INSTALL_LIBDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
dynlink.cmti dynlink.mli \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) dynlink.cmti dynlink.mli "$(INSTALL_LIBDIR)"
endif

installopt:
Expand Down
8 changes: 2 additions & 6 deletions otherlibs/systhreads/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,9 @@ install:
$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
mkdir -p "$(INSTALL_THREADSLIBDIR)"
$(INSTALL_DATA) \
$(CMIFILES) threads.cma \
"$(INSTALL_THREADSLIBDIR)"
$(INSTALL_DATA) $(CMIFILES) threads.cma "$(INSTALL_THREADSLIBDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
$(CMIFILES:.cmi=.cmti) \
"$(INSTALL_THREADSLIBDIR)"
$(INSTALL_DATA) $(CMIFILES:.cmi=.cmti) "$(INSTALL_THREADSLIBDIR)"
$(INSTALL_DATA) $(MLIFILES) "$(INSTALL_THREADSLIBDIR)"
endif
$(INSTALL_DATA) threads.h "$(INSTALL_LIBDIR)/caml"
Expand Down
4 changes: 1 addition & 3 deletions stdlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ install::
stdlib.cma std_exit.cmo *.cmi camlheader_ur \
"$(INSTALL_LIBDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
*.cmt *.cmti *.mli *.ml \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) *.cmt *.cmti *.mli *.ml "$(INSTALL_LIBDIR)"
endif
$(INSTALL_DATA) target_camlheader "$(INSTALL_LIBDIR)/camlheader"

Expand Down
16 changes: 4 additions & 12 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,13 @@ ocamloptp.opt$(EXE): $(call byte2native, $(OCAMLCP) ocamloptp.cmo)
opt:: profiling.cmx

install::
$(INSTALL_DATA) \
profiling.cmi profiling.cmo \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) profiling.cmi profiling.cmo "$(INSTALL_LIBDIR)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
profiling.cmt profiling.cmti \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) profiling.cmt profiling.cmti "$(INSTALL_LIBDIR)"
endif

installopt::
$(INSTALL_DATA) \
profiling.cmx profiling.$(O) \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) profiling.cmx profiling.$(O) "$(INSTALL_LIBDIR)"

# To help building mixed-mode libraries (OCaml + C)
OCAMLMKLIB = config.cmo build_path_prefix_map.cmo misc.cmo ocamlmklib.cmo
Expand Down Expand Up @@ -271,9 +265,7 @@ clean::
# Eventlog metadata file

install::
$(INSTALL_DATA) \
eventlog_metadata \
"$(INSTALL_LIBDIR)"
$(INSTALL_DATA) eventlog_metadata "$(INSTALL_LIBDIR)"

# Copy a bytecode executable, stripping debug info

Expand Down

0 comments on commit 26217ca

Please sign in to comment.