Skip to content

Commit

Permalink
otp: Fix make TYPE=$TYPE to work for all types
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Jan 21, 2022
1 parent 0e8e4d0 commit dda051e
Show file tree
Hide file tree
Showing 139 changed files with 173 additions and 169 deletions.
6 changes: 3 additions & 3 deletions erts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ docs:
$(V_at)( cd doc/src && $(MAKE) $@ )

.PHONY: debug opt lcnt clean test
debug opt lcnt clean:
$(TYPES) clean:
$(V_at)for d in emulator $(ERTSDIRS); do \
if test -d $$d; then \
( cd $$d && $(MAKE) $@ ) || exit $$?; \
Expand All @@ -57,7 +57,7 @@ test:

.PHONY: $(FLAVORS)
$(FLAVORS):
$(V_at)for type in $(TYPES); do \
$(V_at)for type in $(DEFAULT_TYPES); do \
( $(MAKE) FLAVOR=$@ $$type ) || exit $$?; \
done

Expand Down Expand Up @@ -150,7 +150,7 @@ makefiles:
.PHONY: release
release:
ifeq ($(TYPE),)
for t in $(TYPES); do \
for t in $(DEFAULT_TYPES); do \
( cd emulator && $(MAKE) release TYPE=$$t ) || exit $$?; \
done
else
Expand Down
6 changes: 3 additions & 3 deletions erts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ EMU_THR_DEFS
EMU_THR_LIBS
EMU_THR_X_LIBS
EMU_THR_LIB_NAME
TYPES
DEFAULT_TYPES
DIRTY_SCHEDULER_TEST
ETHR_X86_SSE2_ASM
ETHR_THR_LIB_BASE_DIR
Expand Down Expand Up @@ -15015,7 +15015,7 @@ if test "X$ETHR_LIB_NAME" = "X"; then
as_fn_error $? "cannot build emulator since no thread library was found" "$LINENO" 5
fi

TYPES=opt
DEFAULT_TYPES="opt"

DIRTY_SCHEDULER_TEST=$enable_dirty_schedulers_test

Expand Down Expand Up @@ -15259,7 +15259,7 @@ printf %s "checking whether lock counters should be enabled... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_lock_count" >&5
printf "%s\n" "$enable_lock_count" >&6; }
if test "x$enable_lock_count" != "xno"; then
TYPES="$TYPES lcnt"
DEFAULT_TYPES="$DEFAULT_TYPES lcnt"
fi

case $host_os in
Expand Down
6 changes: 3 additions & 3 deletions erts/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ if test "X$ETHR_LIB_NAME" = "X"; then
AC_MSG_ERROR([cannot build emulator since no thread library was found])
fi

TYPES=opt
DEFAULT_TYPES="opt"

DIRTY_SCHEDULER_TEST=$enable_dirty_schedulers_test
AC_SUBST(DIRTY_SCHEDULER_TEST)
Expand Down Expand Up @@ -1091,7 +1091,7 @@ EOF
;;

esac
AC_SUBST(TYPES)
AC_SUBST(DEFAULT_TYPES)

AC_CHECK_FUNCS([posix_fadvise closefrom])
AC_CHECK_HEADERS([linux/falloc.h])
Expand Down Expand Up @@ -1178,7 +1178,7 @@ fi
AC_MSG_CHECKING(whether lock counters should be enabled)
AC_MSG_RESULT($enable_lock_count)
if test "x$enable_lock_count" != "xno"; then
TYPES="$TYPES lcnt"
DEFAULT_TYPES="$DEFAULT_TYPES lcnt"
fi

case $host_os in
Expand Down
1 change: 1 addition & 0 deletions erts/etc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# %CopyrightEnd%
#
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk

SUB_DIRECTORIES = common
ifeq ($(TARGET),win32)
Expand Down
2 changes: 1 addition & 1 deletion erts/etc/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
include ../../vsn.mk

opt debug lcnt: etc
$(TYPES): etc

.PHONY: etc
etc: etp-commands
Expand Down
3 changes: 2 additions & 1 deletion lib/asn1/c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ _create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR))

opt: $(NIF_SHARED_OBJ_FILE)

debug: opt
$(filter-out opt, $(TYPES)):
@${MAKE} TYPE=$@ opt

static_lib: $(NIF_LIB_FILE)

Expand Down
2 changes: 1 addition & 1 deletion lib/asn1/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ YRL_FLAGS =
# Targets
# ----------------------------------------------------

debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
$(TYPES): $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)


clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/asn1/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ EBIN = .
$(EMAKEFILE): $(ERL_FILES) $(HRL_FILES)
$(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) $(ERL_FILES) >$(EMAKEFILE)

tests debug opt: $(EMAKEFILE)
tests $(TYPES): $(EMAKEFILE)

clean:
rm -f core
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ APPUP_FILE= common_test.appup
APPUP_SRC= $(APPUP_FILE).src
APPUP_TARGET= $(EBIN)/$(APPUP_FILE)

tests debug opt: $(TARGET_FILES)
tests $(TYPES): $(TARGET_FILES)

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ EBIN = .
# $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES)\
# > $(EMAKEFILE)

tests debug opt:
tests $(TYPES):
erl $(ERL_MAKE_FLAGS) -make

clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/test_server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ERL_COMPILE_FLAGS += -I../include -Werror
# Targets
# ----------------------------------------------------

tests debug opt: $(TS_TARGETS)
tests $(TYPES): $(TS_TARGETS)

clean:
rm -f $(TS_TARGET_FILES)
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ERL_COMPILE_FLAGS += +inline +warn_unused_import \
# Targets
# ----------------------------------------------------

debug opt: $(TARGET_FILES)
$(TYPES): $(TARGET_FILES)

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ make_emakefile: $(NO_OPT_ERL_FILES) $(POST_OPT_ERL_FILES) $(NO_SSA_OPT_ERL_FILES
$(ERL_TOP)/make/make_emakefile +dialyzer $(ERL_COMPILE_FLAGS) \
-o$(EBIN) $(DIALYZER_MODULES) >> $(EMAKEFILE)

tests debug opt: make_emakefile
tests $(TYPES): make_emakefile
erl $(ERL_MAKE_FLAGS) -make

clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ERL_COMPILE_FLAGS += -DCRYPTO_VSN=\"$(VSN)\" -Werror -I../include
# Targets
# ----------------------------------------------------

debug opt valgrind asan: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
$(TYPES): $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)

clean:
rm -f $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ EBIN = .
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
tests opt debug: $(TARGET_FILES)
tests $(TYPES): $(TARGET_FILES)

clean:
rm -f $(TARGET_FILES)
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/priv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TOOLBAR_FILES = \
# Rules
#

debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ERL_COMPILE_FLAGS += -Werror
# Targets
# ----------------------------------------------------

debug opt: $(TARGET_FILES) $(TARGET_TOOLBOX_FILES)
$(TYPES): $(TARGET_FILES) $(TARGET_TOOLBOX_FILES)

clean:
rm -f $(TARGET_FILES) $(TARGET_TOOLBOX_FILES)
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ make_emakefile:
$(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' \
>> $(EMAKEFILE)

tests debug opt: make_emakefile
tests $(TYPES): make_emakefile
erl $(ERL_MAKE_FLAGS) -make

clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/dialyzer/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ERL_COMPILE_FLAGS += +warn_export_vars +warn_unused_import +warn_missing_spec
# Targets
# ----------------------------------------------------

debug opt: $(TARGET_FILES)
$(TYPES): $(TARGET_FILES)

docs:

Expand Down
4 changes: 2 additions & 2 deletions lib/diameter/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ patch:
git diff --exit-code HEAD
$(MAKE) opt PRE_VSN="-$(shell git rev-list --max-count=1 HEAD | cut -c 1-8)"

debug:
@$(MAKE) TYPE=debug opt
$(filter-out opt, $(TYPES)):
@${MAKE} TYPE=$@ opt

# The dictionary parser.
gen/$(DICT_YRL).erl: compiler/$(DICT_YRL).yrl
Expand Down
2 changes: 1 addition & 1 deletion lib/diameter/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ERL_COMPILE_FLAGS += +warn_export_vars \
# Targets
# ----------------------------------------------------

all debug opt: $(TARGET_FILES)
all $(TYPES): $(TARGET_FILES)

strict:
$(MAKE) opt STRICT_FLAGS=-Werror
Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ESCRIPT_FILES= \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ info:



debug opt:
$(TYPES):


clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/include/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ INCLUDE_FILES = edoc_doclet.hrl
# ----------------------------------------------------
# Make Rules
# ----------------------------------------------------
debug opt:
$(TYPES):

clean:

Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/priv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/edoc-$(EDOC_VSN)
GEN_SCRIPT = edoc_generate
PRIV_FILES = stylesheet.css erlang.png edoc.dtd

debug opt:
$(TYPES):

clean:
rm -f core *~
Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
# Targets
# ----------------------------------------------------

debug opt: $(OBJECTS)
$(TYPES): $(OBJECTS)

all: $(OBJECTS)

Expand Down
2 changes: 1 addition & 1 deletion lib/edoc/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ make_emakefile:
$(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' \
>> $(EMAKEFILE)

tests debug opt: make_emakefile
tests $(TYPES): make_emakefile
erl $(ERL_MAKE_FLAGS) -make

clean:
Expand Down
4 changes: 2 additions & 2 deletions lib/eldap/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ ERL_COMPILE_FLAGS += -I../include -I../ebin -Werror
# ----------------------------------------------------
opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)

debug:
@${MAKE} TYPE=debug opt
$(filter-out opt, $(TYPES)):
@${MAKE} TYPE=$@ opt

clean:
rm -f $(TARGET_FILES) $(GEN_FILES) $(APP_TARGET) $(APPUP_TARGET)
Expand Down
2 changes: 1 addition & 1 deletion lib/eldap/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ EBIN = .
# Targets
# ----------------------------------------------------

tests debug opt: $(TARGET_FILES)
tests $(TYPES): $(TARGET_FILES)


clean:
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ESCRIPT_FILES= \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/css/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CSS_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

DOC_TARGETS?=html

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/dtd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ENT_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/dtd_html_entities/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ENTITY_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/dtd_man_entities/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ENTITY_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PNG_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

DOC_TARGETS?=html

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/js/flipmenu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ JS_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

DOC_TARGETS?=html

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/xsl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ XSL_FILES = \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
debug opt:
$(TYPES):

docs:

Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ERL_COMPILE_FLAGS += -I../../xmerl/include
# Targets
# ----------------------------------------------------

debug opt: $(TARGET_FILES)
$(TYPES): $(TARGET_FILES)

clean:
rm -f $(TARGET_FILES)
Expand Down
Loading

0 comments on commit dda051e

Please sign in to comment.