Skip to content

Commit

Permalink
otp: Refactor second and third bootstrap
Browse files Browse the repository at this point in the history
We move all the logic around bootstraps to the top
Makefile.in instead of sharing it with lib/Makefile.

Now there is a single place that lists which applications
are part of which bootstrap and which need to be built or
not built.
  • Loading branch information
garazdawi committed Oct 18, 2022
1 parent ee862db commit d629c17
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 362 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ JAVADOC-GENERATED
/bootstrap/lib/edoc
/bootstrap/lib/erl_docgen
/bootstrap/lib/erl_interface
/bootstrap/lib/hipe
/bootstrap/lib/jinterface
/bootstrap/lib/parsetools
/bootstrap/lib/public_key
/bootstrap/lib/runtime_tools
/bootstrap/lib/sasl
/bootstrap/lib/snmp
/bootstrap/lib/syntax_tools
/bootstrap/lib/test_server
/bootstrap/lib/wx
/bootstrap/lib/xmerl

Expand Down
387 changes: 67 additions & 320 deletions Makefile.in

Large diffs are not rendered by default.

27 changes: 5 additions & 22 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,11 @@ ifdef BUILD_STATIC_LIBS
SUB_DIRECTORIES = asn1 crypto
else
ifdef BOOTSTRAP
SUB_DIRECTORIES = \
kernel stdlib compiler
else
ifdef SECONDARY_BOOTSTRAP
ifdef TINY_BUILD
SUB_DIRECTORIES = parsetools sasl
else
SUB_DIRECTORIES = parsetools asn1/src
endif
else
ifdef TERTIARY_BOOTSTRAP
SUB_DIRECTORIES = snmp sasl erl_interface jinterface syntax_tools wx public_key
else
ifdef DOC_BOOTSTRAP
SUB_DIRECTORIES = xmerl edoc erl_docgen public_key
else # Not bootstrap build
SUB_DIRECTORIES = $(ERTS_APPLICATIONS) \
$(ERLANG_APPLICATIONS) \
$(EXTRA_APPLICATIONS)
endif
endif
endif
SUB_DIRECTORIES = $(BOOTSTRAP)
else # Not bootstrap build
SUB_DIRECTORIES = $(ERTS_APPLICATIONS) \
$(ERLANG_APPLICATIONS) \
$(EXTRA_APPLICATIONS)
endif
endif

Expand Down
3 changes: 0 additions & 3 deletions lib/common_test/src/ct_property_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
print_frequency/0
]).

%%% Mandatory include
-include_lib("common_test/include/ct.hrl").

%%%================================================================
%%%
%%% API
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/cth_conn_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
%%----------------------------------------------------------------------
-module(cth_conn_log).

-include_lib("common_test/include/ct.hrl").
-include("ct.hrl").

-export([init/2,
pre_init_per_testcase/4,
Expand Down
9 changes: 0 additions & 9 deletions lib/inets/test/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ DEFAULT_TARGETS = opt debug instr release release_docs clean docs
# ----------------------------------------------------
EMULATOR = beam

ifdef BOOTSTRAP
ERL_COMPILE_FLAGS += +slim
else
ERL_COMPILE_FLAGS += +debug_info
endif
ERLC_WFLAGS = -W
ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS)
ERL.beam = erl.beam -boot start_clean
Expand All @@ -47,8 +43,3 @@ $(EBIN)/%.beam: $(ESRC)/%.erl

.erl.beam:
$(ERLC) -bbeam $(ERL_COMPILE_FLAGS) -o$(dir $@) $<





4 changes: 2 additions & 2 deletions lib/wx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
include ./vsn.mk
include ./config.mk

ifdef TERTIARY_BOOTSTRAP
ifdef BOOTSTRAP
SUBDIRS = src
else # Normal build
SUBDIRS = src
ifeq ($(CAN_BUILD_DRIVER), true)
SUBDIRS += c_src
endif
SUBDIRS += examples doc/src
endif #TERTIARY_BOOTSTRAP
endif #BOOTSTRAP

CLEANDIRS = $(SUBDIRS) api_gen

Expand Down
2 changes: 1 addition & 1 deletion lib/wx/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#

include ../vsn.mk
ifdef TERTIARY_BOOTSTRAP
ifdef BOOTSTRAP
VSN = $(WX_VSN)
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
Expand Down
2 changes: 1 addition & 1 deletion make/otp.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ EMULATOR = beam
ifeq ($(ERL_COMPILE_WARNINGS_AS_ERRORS),yes)
ERL_COMPILE_FLAGS += -Werror
endif
ifdef BOOTSTRAP
ifdef PRIMARY_BOOTSTRAP
ERL_COMPILE_FLAGS += +slim
else
ERL_COMPILE_FLAGS += +debug_info
Expand Down

0 comments on commit d629c17

Please sign in to comment.