diff options
Diffstat (limited to 'make')
-rwxr-xr-x | make/cross_check_erl | 40 | ||||
-rw-r--r-- | make/emd2exml.in | 83 | ||||
-rwxr-xr-x | make/fakefop | 19 | ||||
-rwxr-xr-x | make/install_bin | 19 | ||||
-rw-r--r-- | make/lazy_configure.mk | 21 | ||||
-rwxr-xr-x | make/make_emakefile | 2 | ||||
-rw-r--r-- | make/otp.mk.in | 36 | ||||
-rw-r--r-- | make/otp_ded.mk.in | 20 | ||||
-rw-r--r-- | make/otp_default_release_path.mk | 25 | ||||
-rw-r--r-- | make/otp_release_targets.mk | 37 | ||||
-rw-r--r-- | make/otp_released_app.mk | 44 | ||||
-rw-r--r-- | make/otp_subdir.mk | 34 | ||||
-rw-r--r-- | make/output.mk.in | 24 | ||||
-rw-r--r-- | make/run_make.mk | 25 | ||||
-rwxr-xr-x | make/save_args | 21 | ||||
-rw-r--r-- | make/target.mk | 19 | ||||
-rwxr-xr-x | make/unexpected_use | 19 | ||||
-rwxr-xr-x | make/verify_runtime_dependencies | 314 |
18 files changed, 613 insertions, 189 deletions
diff --git a/make/cross_check_erl b/make/cross_check_erl index cb9dadfb32..f8ba73023a 100755 --- a/make/cross_check_erl +++ b/make/cross_check_erl @@ -4,16 +4,17 @@ # # Copyright Ericsson AB 2010. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # @@ -61,16 +62,17 @@ cat > cross_check_erl.erl <<\EOF % % Copyright Ericsson AB 2010. All Rights Reserved. % -% The contents of this file are subject to the Erlang Public License, -% Version 1.1, (the "License"); you may not use this file except in -% compliance with the License. You should have received a copy of the -% Erlang Public License along with this software. If not, it can be -% retrieved online at http://www.erlang.org/. -% -% Software distributed under the License is distributed on an "AS IS" -% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -% the License for the specific language governing rights and limitations -% under the License. +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. % -module(cross_check_erl). diff --git a/make/emd2exml.in b/make/emd2exml.in index 5bfe89894e..903d707716 100644 --- a/make/emd2exml.in +++ b/make/emd2exml.in @@ -7,16 +7,17 @@ %% %% Copyright Ericsson AB 2010-2013. All Rights Reserved. %% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at %% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% %% @@ -38,7 +39,7 @@ %%% Created : 25 Feb 2010 by Rickard Green %%%------------------------------------------------------------------- --define(MAX_HEADING, 3). +-define(MAX_HEADING, 6). -define(DELAYED_COPYRIGHT_IX, 0). -define(DELAYED_TOC_IX, 1). @@ -79,7 +80,6 @@ copyright = false, copyright_data = [], have_h1 = false, - smarker_ix = false, toc = [], ifile, ofile}). @@ -334,6 +334,8 @@ text(Line) -> text("%ERTS-VSN%" ++ Cs, Acc) -> text(Cs, ["@ERTS_VSN@"|Acc]); +text("%OTP-VSN%" ++ Cs, Acc) -> + text(Cs, ["@OTP_VSN@"|Acc]); text("%OTP-REL%" ++ Cs, Acc) -> text(Cs, ["@OTP_REL@"|Acc]); @@ -357,15 +359,17 @@ put_text(#state{c = CTag, emphasis = EmTag} = S, Line) -> put_text(S, "%ERTS-VSN%"++Cs, CTag, EmTag, Acc) -> put_text(S, Cs, CTag, EmTag, ["@ERTS_VSN@"|Acc]); +put_text(S, "%OTP-VSN%"++Cs, CTag, EmTag, Acc) -> + put_text(S, Cs, CTag, EmTag, ["@OTP_VSN@"|Acc]); put_text(S, "%OTP-REL%"++Cs, CTag, EmTag, Acc) -> put_text(S, Cs, CTag, EmTag, ["@OTP_REL@"|Acc]); put_text(S, [$\\,C|Cs], no, EmTag, Acc) -> put_text(S, Cs, no, EmTag, [C|Acc]); put_text(S, [C,C|Cs], no, b, Acc) when C == $*; C == $_ -> - put_text(S, Cs, no, no, ["</b>"|Acc]); + put_text(S, Cs, no, no, ["</strong>"|Acc]); put_text(S, [C,C|Cs], no, no, Acc) when C == $*; C == $_ -> - put_text(S, Cs, no, b, ["<b>"|Acc]); + put_text(S, Cs, no, b, ["<strong>"|Acc]); put_text(S, [C|Cs], no, em, Acc) when C == $*; C == $_ -> put_text(S, Cs, no, no, ["</em>"|Acc]); put_text(S, [C|Cs], no, no, Acc) when C == $*; C == $_ -> @@ -560,6 +564,8 @@ code(Line) -> code("%ERTS-VSN%" ++ Cs, Acc) -> code(Cs, ["@ERTS_VSN@"|Acc]); +code("%OTP-VSN%" ++ Cs, Acc) -> + code(Cs, ["@OTP_VSN@"|Acc]); code("%OTP-REL%" ++ Cs, Acc) -> code(Cs, ["@OTP_REL@"|Acc]); @@ -607,8 +613,7 @@ strip_lvls(_N, Str) -> put_title(S, 1, Title) -> header(chk_h1(1, S#state{h = 1, mlist = [top]}), Title); put_title(#state{mlist = MList0, - toc = TOC, - smarker_ix = SMarkerIX} = S0, H, Title) -> + toc = TOC} = S0, H, Title) -> TitleStr = text(Title), MList1 = [mk_lvl_marker(Title) | MList0], Marker = mk_marker(MList1), @@ -619,12 +624,10 @@ put_title(#state{mlist = MList0, "<seealso marker=\"#",Marker,"\">", TitleStr,"</seealso>",nl()], h = H, - mlist = MList1, - smarker_ix = false}), - true = is_integer(SMarkerIX), - S2 = write_delayed(S1, SMarkerIX, ["<marker id=\"", Marker, "\"/>",nl()]), + mlist = MList1}), + S2 = put_chars(S1, ["<marker id=\"", Marker, "\"/>",nl()]), {STag, ETag} = case H > ?MAX_HEADING of - true -> {"<p><b>", "</b></p>"}; + true -> {"<p><strong>", "</strong></p>"}; false -> {"<title>", "</title>"} end, put_chars(S2, [STag, TitleStr, ETag, nl()]). @@ -694,15 +697,10 @@ sections_change(H, OldH, #state{mlist = [_|ML], toc = TOC} = S0) -> begin_section(1, S) -> put_line(S, "<chapter>"); -begin_section(H, #state{delayed_array_ix = IX} = S0) when H > ?MAX_HEADING -> - false = S0#state.smarker_ix, - true = is_integer(IX), - put_delayed(S0#state{smarker_ix = IX, delayed_array_ix = IX+1}, IX); -begin_section(H, #state{delayed_array_ix = IX} = S0) when H > 1 -> - false = S0#state.smarker_ix, - true = is_integer(IX), - S1 = put_delayed(S0#state{smarker_ix = IX, delayed_array_ix = IX+1}, IX), - put_line(S1, "<section>"); +begin_section(H, S) when H > ?MAX_HEADING -> + S; +begin_section(H, S0) when H > 1 -> + put_line(S0, "<section>"); begin_section(_H, S) -> S. @@ -772,7 +770,7 @@ create_toc(#state{toc = TOC} = S) -> {value,{"true",[]}} -> write_delayed(S, ?DELAYED_TOC_IX, - ["<p><b>Table of Contents</b></p>", nl(), TOC]); + ["<p><strong>Table of Contents</strong></p>", nl(), TOC]); _ -> write_delayed(S, ?DELAYED_TOC_IX, "") end. @@ -793,16 +791,17 @@ parse_crd([], From, To, Holder, Legal) -> end, case Legal of [] -> - ["The contents of this file are subject to the Erlang Public License,", nl(), - "Version 1.1, (the \"License\"); you may not use this file except in", nl(), - "compliance with the License. You should have received a copy of the", nl(), - "Erlang Public License along with this software. If not, it can be", nl(), - "retrieved online at http://www.erlang.org/.", nl(), - nl(), - "Software distributed under the License is distributed on an \"AS IS\"", nl(), - "basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See", nl(), - "the License for the specific language governing rights and limitations", nl(), - "under the License.", nl()]; + ["Licensed under the Apache License, Version 2.0 (the \"License\");", nl(), + "you may not use this file except in compliance with the License.", nl(), + "You may obtain a copy of the License at", nl(), + nl(), + " http://www.apache.org/licenses/LICENSE-2.0", nl(), + nl(), + "Unless required by applicable law or agreed to in writing, software", nl(), + "distributed under the License is distributed on an \"AS IS\" BASIS,", nl(), + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", nl(), + "See the License for the specific language governing permissions and", nl(), + "limitations under the License.", nl()]; _ -> Legal end}; parse_crd([Line|Lines], OldFrom, OldTo, OldHolder, Legal) -> @@ -978,10 +977,10 @@ chg_bq_lvl(Lvl, #state{bq_lvl = Lvl} = S) -> S; chg_bq_lvl(NewLvl, #state{bq_lvl = Lvl} = S) when NewLvl > Lvl -> chg_bq_lvl(NewLvl, - put_line(end_p(end_code(S#state{bq_lvl = Lvl+1})), "<blockquote>")); + put_line(end_p(end_code(S#state{bq_lvl = Lvl+1})), "<quote>")); chg_bq_lvl(NewLvl, #state{bq_lvl = Lvl} = S) -> chg_bq_lvl(NewLvl, - put_line(end_p(end_code(S#state{bq_lvl = Lvl-1})), "</blockquote>")). + put_line(end_p(end_code(S#state{bq_lvl = Lvl-1})), "</quote>")). %% %% Resolve link diff --git a/make/fakefop b/make/fakefop index b64428bbd1..7beeddf0a5 100755 --- a/make/fakefop +++ b/make/fakefop @@ -5,16 +5,17 @@ # Copyright Tuncer Ayaz 2010-2013. All Rights Reserved. # Copyright Ericsson AB 2010-2013. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/make/install_bin b/make/install_bin index 0d3e82266e..6c9d83e1ca 100755 --- a/make/install_bin +++ b/make/install_bin @@ -4,16 +4,17 @@ # # Copyright Ericsson AB 2010. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/make/lazy_configure.mk b/make/lazy_configure.mk index 320f485d90..c74f216de0 100644 --- a/make/lazy_configure.mk +++ b/make/lazy_configure.mk @@ -1,13 +1,14 @@ -# ``The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved via the world wide web at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# ``Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # The Initial Developer of the Original Code is Ericsson Utvecklings AB. # Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings diff --git a/make/make_emakefile b/make/make_emakefile index 80c4acae94..56440d9bf0 100755 --- a/make/make_emakefile +++ b/make/make_emakefile @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # -*- cperl -*- use strict; diff --git a/make/otp.mk.in b/make/otp.mk.in index 785926b997..c05c499d66 100644 --- a/make/otp.mk.in +++ b/make/otp.mk.in @@ -6,16 +6,17 @@ # # Copyright Ericsson AB 1997-2013. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # @@ -30,6 +31,13 @@ include $(ERL_TOP)/make/output.mk # ---------------------------------------------------- +# Version +# ---------------------------------------------------- + +OTP_VERSION = @OTP_VERSION@ +SYSTEM_VSN = @SYSTEM_VSN@ + +# ---------------------------------------------------- # Cross Compiling # ---------------------------------------------------- CROSS_COMPILING = @CROSS_COMPILING@ @@ -82,14 +90,10 @@ OTP_RELEASE = @OTP_RELEASE@ # Erlang language section # ---------------------------------------------------- EMULATOR = beam -ifeq ($(findstring ose_ppc750,$(TARGET)),ose_ppc750) -ERL_COMPILE_FLAGS += +compressed +ifdef BOOTSTRAP + ERL_COMPILE_FLAGS += +slim else - ifdef BOOTSTRAP - ERL_COMPILE_FLAGS += +slim - else - ERL_COMPILE_FLAGS += +debug_info - endif + ERL_COMPILE_FLAGS += +debug_info endif ERLC_WFLAGS = -W ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS) diff --git a/make/otp_ded.mk.in b/make/otp_ded.mk.in index 0c9a8a087f..0b5311d75e 100644 --- a/make/otp_ded.mk.in +++ b/make/otp_ded.mk.in @@ -4,16 +4,17 @@ # # Copyright Ericsson AB 2009-2013. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% @@ -38,6 +39,7 @@ DED_THR_DEFS = @DED_THR_DEFS@ DED_EMU_THR_DEFS = @DED_EMU_THR_DEFS@ DED_WARN_FLAGS = @WFLAGS@ DED_CFLAGS = @WERRORFLAGS@ @WFLAGS@ @DED_EMU_THR_DEFS@ @DED_CFLAGS@ +DED_STATIC_CFLAGS = @WERRORFLAGS@ @WFLAGS@ @DED_EMU_THR_DEFS@ @DED_STATIC_CFLAGS@ DED_LIBS = @LIBS@ DED_EXT = @DED_EXT@ ERLANG_OSTYPE = @ERLANG_OSTYPE@ diff --git a/make/otp_default_release_path.mk b/make/otp_default_release_path.mk new file mode 100644 index 0000000000..bdaaca53ea --- /dev/null +++ b/make/otp_default_release_path.mk @@ -0,0 +1,25 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2014. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# %CopyrightEnd% +# + +# +# Where to release to by default +# + +OTP_DEFAULT_RELEASE_PATH="$(ERL_TOP)/release/$(TARGET)" diff --git a/make/otp_release_targets.mk b/make/otp_release_targets.mk index b6afcd1c8b..13b54645ad 100644 --- a/make/otp_release_targets.mk +++ b/make/otp_release_targets.mk @@ -3,20 +3,23 @@ # # Copyright Ericsson AB 1997-2013. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # +include $(ERL_TOP)/make/otp_default_release_path.mk + # ---------------------------------------------------- # Targets for the new documentation support # ---------------------------------------------------- @@ -42,6 +45,7 @@ $(HTMLDIR)/index.html: $(XML_FILES) $(SPECS_FILES) --stringparam gendate "$$date" \ --stringparam appname "$(APPLICATION)" \ --stringparam appver "$(VSN)" \ + --stringparam extra_front_page_info "$(DOC_EXTRA_FRONT_PAGE_INFO)" \ --stringparam stylesheet "$(CSS_FILE)" \ --stringparam winprefix "$(WINPREFIX)" \ --stringparam logo "$(HTMLLOGO_FILE)" \ @@ -62,6 +66,7 @@ $(HTMLDIR)/users_guide.html: $(XML_FILES) --stringparam gendate "$$date" \ --stringparam appname "$(APPLICATION)" \ --stringparam appver "$(VSN)" \ + --stringparam extra_front_page_info "$(DOC_EXTRA_FRONT_PAGE_INFO)" \ --stringparam stylesheet "$(CSS_FILE)" \ --stringparam winprefix "$(WINPREFIX)" \ --stringparam logo "$(HTMLLOGO_FILE)" \ @@ -78,6 +83,7 @@ $(HTMLDIR)/users_guide.html: $(XML_FILES) --stringparam gendate "$$date" \ --stringparam appname "$(APPLICATION)" \ --stringparam appver "$(VSN)" \ + --stringparam extra_front_page_info "$(DOC_EXTRA_FRONT_PAGE_INFO)" \ --stringparam logo "$(PDFLOGO_FILE)" \ --stringparam pdfcolor "$(PDFCOLOR)" \ --xinclude $(TOP_SPECS_PARAM) \ @@ -107,7 +113,16 @@ $(HTMLDIR)/$(APPLICATION).eix: $(XML_FILES) $(SPECS_FILES) docs: $(HTMLDIR)/$(APPLICATION).eix xmllint: $(XML_FILES) - $(XMLLINT) --noout --valid --nodefdtd --loaddtd --path $(DOCGEN)/priv/dtd:$(DOCGEN)/priv/dtd_html_entities $(XML_FILES) + @echo "Running xmllint" + @BookFiles=`awk -F\" '/xi:include/ {print $$2}' book.xml`; \ + for i in $$BookFiles; do \ + if [ $$i = "notes.xml" ]; then \ + echo Checking $$i; \ + xmllint --noout --valid --nodefdtd --loaddtd --path $(DOCGEN)/priv/dtd:$(DOCGEN)/priv/dtd_html_entities $$i; \ + else\ + awk -F\" '/xi:include/ {print "echo Checking " $$2 ;print "xmllint --noout --valid --nodefdtd --loaddtd --path $(DOCGEN)/priv/dtd:$(DOCGEN)/priv/dtd_html_entities:$(XMLLINT_SRCDIRS) " $$2}' $$i |sh; \ + fi \ + done # ---------------------------------------------------- # Local documentation target for testing @@ -137,7 +152,7 @@ endif ifeq ($(TESTROOT),) release release_docs release_tests release_html: - $(MAKE) $(MFLAGS) RELEASE_PATH="$(ERL_TOP)/release/$(TARGET)" \ + $(MAKE) $(MFLAGS) RELEASE_PATH=$(OTP_DEFAULT_RELEASE_PATH) \ $(TARGET_MAKEFILE) $@_spec else diff --git a/make/otp_released_app.mk b/make/otp_released_app.mk new file mode 100644 index 0000000000..71d1771b47 --- /dev/null +++ b/make/otp_released_app.mk @@ -0,0 +1,44 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2014. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# %CopyrightEnd% + +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk +include $(APP_PWD)/vsn.mk +include $(ERL_TOP)/make/otp_default_release_path.mk + +RELEASED_APP_VSN=$(APP)-$($(APP_VSN)) +ifeq ($(TESTROOT),) +REL_DIR=$(OTP_DEFAULT_RELEASE_PATH)/releases/$(SYSTEM_VSN) +else +REL_DIR=$(TESTROOT)/releases/$(SYSTEM_VSN) +endif +INST_APP_VSNS=$(REL_DIR)/installed_application_versions + +.PHONY: update + +update: + test -d "$(REL_DIR)" || mkdir -p "$(REL_DIR)" ; \ + if test ! -f "$(INST_APP_VSNS)" ; then \ + echo "$(RELEASED_APP_VSN)" > "$(INST_APP_VSNS)" || exit 1; \ + else \ + if test x = x`grep $(RELEASED_APP_VSN) "$(INST_APP_VSNS)"` ; then \ + echo $(RELEASED_APP_VSN) >> "$(INST_APP_VSNS)" || exit 1; \ + fi ; \ + fi + diff --git a/make/otp_subdir.mk b/make/otp_subdir.mk index 07294c272d..fa6470ddd7 100644 --- a/make/otp_subdir.mk +++ b/make/otp_subdir.mk @@ -3,28 +3,29 @@ # # Copyright Ericsson AB 1997-2011. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # # Make include file for otp .PHONY: debug opt release docs release_docs tests release_tests \ - clean depend valgrind + clean depend valgrind static_lib # # Targets that don't affect documentation directories # -opt debug release docs release_docs tests release_tests clean depend valgrind: +opt debug release docs release_docs tests release_tests clean depend valgrind static_lib: @set -e ; \ app_pwd=`pwd` ; \ if test -f vsn.mk; then \ @@ -44,5 +45,14 @@ opt debug release docs release_docs tests release_tests clean depend valgrind: fi ; \ done ; \ if test -f vsn.mk; then \ + if test release = $@ && test ! -f SKIP; then \ + app=`basename $$app_pwd` ; \ + app_vsn=`echo $$app | sed "y|abcdefghijklmnopqrstuvwxyz|ABCDEFGHIJKLMNOPQRSTUVWXYZ|"` ; \ + app_vsn=$${app_vsn}_VSN ; \ + ( $(MAKE) -f "$(ERL_TOP)/make/otp_released_app.mk" \ + APP_PWD="$$app_pwd" APP_VSN=$$app_vsn APP=$$app \ + TESTROOT="$(TESTROOT)" update) \ + || exit $$? ; \ + fi ; \ echo "=== Leaving application" `basename $$app_pwd` ; \ fi diff --git a/make/output.mk.in b/make/output.mk.in index 938f878ebe..171d2456aa 100644 --- a/make/output.mk.in +++ b/make/output.mk.in @@ -6,16 +6,17 @@ # # Copyright Ericsson AB 1997-2013. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # @@ -65,8 +66,9 @@ cc_verbose_0 = @echo " CC "$@; cc_verbose = $(cc_verbose_$(V)) V_CC = $(cc_verbose)$(CC) -cpp_verbose_0 = @echo " CPP "$@; -cpp_verbose = $(cpp_verbose_$(V)) +cxx_verbose_0 = @echo " CXX "$@; +cxx_verbose = $(cxx_verbose_$(V)) +V_CXX = $(cxx_verbose)$(CXX) # For the diameter compiler. dia_verbose_0 = @echo " DIA "$@; diff --git a/make/run_make.mk b/make/run_make.mk index bb0da6743c..2591a37cad 100644 --- a/make/run_make.mk +++ b/make/run_make.mk @@ -1,13 +1,14 @@ -# ``The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved via the world wide web at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# ``Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # The Initial Developer of the Original Code is Ericsson Utvecklings AB. # Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings @@ -30,14 +31,14 @@ include $(ERL_TOP)/make/target.mk .PHONY: valgrind -opt debug purify quantify purecov valgrind gcov gprof lcnt frmptr: +opt debug purify quantify purecov valgrind gcov gprof lcnt frmptr icount: $(make_verbose)$(MAKE) -f $(TARGET)/Makefile TYPE=$@ plain smp frag smp_frag: $(make_verbose)$(MAKE) -f $(TARGET)/Makefile FLAVOR=$@ clean generate depend docs release release_spec release_docs release_docs_spec \ - tests release_tests release_tests_spec: + tests release_tests release_tests_spec static_lib: $(make_verbose)$(MAKE) -f $(TARGET)/Makefile $@ diff --git a/make/save_args b/make/save_args index 331cde99e1..1109f8dd1b 100755 --- a/make/save_args +++ b/make/save_args @@ -1,15 +1,16 @@ #!/bin/sh # -# ``The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved via the world wide web at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# ``Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # The Initial Developer of the Original Code is Ericsson Utvecklings AB. # Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings diff --git a/make/target.mk b/make/target.mk index 4e13779461..8917e1ae44 100644 --- a/make/target.mk +++ b/make/target.mk @@ -3,16 +3,17 @@ # # Copyright Ericsson AB 1998-2011. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% diff --git a/make/unexpected_use b/make/unexpected_use index d7543a7d83..58f6fc4793 100755 --- a/make/unexpected_use +++ b/make/unexpected_use @@ -4,16 +4,17 @@ # # Copyright Ericsson AB 2010. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/make/verify_runtime_dependencies b/make/verify_runtime_dependencies new file mode 100755 index 0000000000..cd08091a67 --- /dev/null +++ b/make/verify_runtime_dependencies @@ -0,0 +1,314 @@ +#!/usr/bin/env escript +%% -*- erlang -*- + +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2014. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% @author Rickard Green <[email protected]> +%%% @copyright (C) 2014, Rickard Green +%%% @doc +%%% Verify runtime dependencies when patching OTP applications. +%%% @end +%%% Created : 4 Mar 2014 by Rickard Green <[email protected]> +%%%------------------------------------------------------------------- + +-mode(compile). + +-export([main/1]). + +main(Args) -> + {Force, Release, SourceDir, TargetDir, AppList} = parse_args(Args, + false, + [], + [], + [], + []), + SourceAppInfo = read_source_app_info(AppList, SourceDir), + AppVsnsTab0 = current_target_app_vsns(TargetDir, Release), + AppVsnsTab1 = add_source_app_vsns(SourceAppInfo, AppVsnsTab0), + case verify_runtime_deps(SourceAppInfo, AppVsnsTab1, true) of + true -> + ok; + false -> + case Force of + true -> + warn("Your OTP development system was updated with " + "unfulfilled runtime dependencies. The system " + "may not be working as expected.", []); + false -> + err("Unfulfilled runtime dependencies. " + "See warnings above.~n", []) + end + end, + halt(0). + +parse_args(["-force" | Args], _, Release, SourceDir, TargetDir, Apps) -> + parse_args(Args, true, Release, SourceDir, TargetDir, Apps); +parse_args(["-release", Release | Args], Force, _, SourceDir, TargetDir, Apps) -> + parse_args(Args, Force, Release, SourceDir, TargetDir, Apps); +parse_args(["-source", SourceDir | Args], Force, Release, _, TargetDir, Apps) -> + parse_args(Args, Force, Release, SourceDir, TargetDir, Apps); +parse_args(["-target", TargetDir | Args], Force, Release, SourceDir, _, Apps) -> + parse_args(Args, Force, Release, SourceDir, TargetDir, Apps); +parse_args([App | Args], Force, Release, SourceDir, TargetDir, OldApps) -> + parse_args(Args, Force, Release, SourceDir, TargetDir, [App | OldApps]); +parse_args([], _, [], _, _, _) -> + err("Missing release~n", []); +parse_args([], _, _, [], _, _) -> + err("Missing source directory~n", []); +parse_args([], _, _, _, [], _) -> + err("Missing target directory~n", []); +parse_args([], _, _, _, _, []) -> + err("Missing applications~n"); +parse_args([], Force, Release, SourceDir, TargetDir, Apps) -> + {Force, Release, SourceDir, TargetDir, Apps}. + + +%warn(Format) -> +% warn(Format, []). + +warn(Format, Args) -> + io:format(standard_error, "WARNING: " ++ Format, Args). + +err(Format) -> + err(Format, []). + +err(Format, Args) -> + io:format(standard_error, "ERROR: " ++ Format, Args), + halt(1). + +read_file(FileName) -> + case file:read_file(FileName) of + {ok, Content} -> + binary_to_list(Content); + {error, Error} -> + err("Failed to read ~s: ~p~n", [FileName, Error]) + end. + +consult_file(FileName) -> + case file:consult(FileName) of + {ok, Terms} -> + Terms; + {error, Error} -> + err("Failed to consult ~s: ~p~n", [FileName, Error]) + end. + +current_target_app_vsns(TargetDir, Release) -> + IAV = read_file(filename:join([TargetDir, "releases", Release, + "installed_application_versions"])), + DirList = string:tokens(IAV, "\n\r\t "), + LibDir = filename:join(TargetDir, "lib"), + make_app_vsns_tab(DirList, LibDir, gb_trees:empty()). + +make_app_vsns_tab([], _LibDir, GBT) -> + GBT; +make_app_vsns_tab([AppVer | AppVsns], LibDir, GBT0) -> + GBT1 = try + case file:read_file_info(filename:join(LibDir, AppVer)) of + {ok, _FInfo} -> + [App, Vsn] = string:tokens(AppVer, "-"), + add_app_vsn(App, Vsn, GBT0); + _ -> + GBT0 + end + catch + _:_ -> + warn("Unexpected directory: ~p~n", + [filename:join(LibDir, AppVer)]), + GBT0 + end, + make_app_vsns_tab(AppVsns, LibDir, GBT1). + +add_app_vsn(App, VsnList, GBT) when is_atom(App) -> + Vsn = parse_vsn(VsnList), + case gb_trees:lookup(App, GBT) of + none -> + gb_trees:insert(App, [Vsn], GBT); + {value, Vsns} -> + gb_trees:update(App, [Vsn | Vsns], GBT) + end; +add_app_vsn(AppStr, VsnList, GBT) -> + add_app_vsn(list_to_atom(AppStr), VsnList, GBT). + +add_source_app_vsns([], AppVsnsTab) -> + AppVsnsTab; +add_source_app_vsns([{App, Vsn, _IReqs} | AI], AppVsnsTab) -> + add_source_app_vsns(AI, add_app_vsn(App, Vsn, AppVsnsTab)). + +read_source_app_info([], _SourceDir) -> + []; +read_source_app_info([App | Apps], SourceDir) -> + AppFile = case App of + "erts" -> + filename:join([SourceDir, "erts", "preloaded", "ebin", + "erts.app"]); + _ -> + filename:join([SourceDir, "lib", App, "ebin", + App ++ ".app"]) + end, + AppAtom = list_to_atom(App), + case consult_file(AppFile) of + [{application, AppAtom, InfoList}] -> + Vsn = case lists:keyfind(vsn, 1, InfoList) of + {vsn, V} -> + V; + _ -> + err("Missing vsn in ~p~n", AppFile) + end, + AI = case lists:keyfind(runtime_dependencies, 1, InfoList) of + {runtime_dependencies, IReqs} -> + case parse_inst_reqs(IReqs) of + error -> + err("Failed to parse runtime_dependencies in ~p~n", + [AppFile]); + ParsedIReqs -> + {AppAtom, Vsn, ParsedIReqs} + end; + _ -> + {AppAtom, Vsn, []} + end, + [AI | read_source_app_info(Apps, SourceDir)]; + _ -> + err("Failed to parse ~p~n", [AppFile]) + end. + +parse_vsn(VsnStr) -> + list_to_tuple(lists:map(fun (IL) -> + list_to_integer(IL) + end, string:tokens(VsnStr, "."))). + +parse_inst_reqs(InstReqs) -> + try + parse_inst_reqs_aux(InstReqs) + catch + _ : _ -> + error + end. + +parse_inst_reqs_aux([]) -> + []; +parse_inst_reqs_aux([IR | IRs]) -> + [App, VsnStr] = string:tokens(IR, "-"), + [{list_to_atom(App), parse_vsn(VsnStr)} | parse_inst_reqs_aux(IRs)]. + +make_app_vsn_str({App, VsnTup}) -> + make_app_vsn_str(tuple_to_list(VsnTup), [atom_to_list(App), $-]). + +make_app_vsn_str([I], Acc) -> + lists:flatten([Acc, integer_to_list(I)]); +make_app_vsn_str([I | Is], Acc) -> + make_app_vsn_str(Is, [Acc, integer_to_list(I), $.]). + +missing_min_req(App, AppVsn, IReq) -> + warn("Unfulfilled runtime dependency for application ~p-~s: ~s~n", + [App, AppVsn, make_app_vsn_str(IReq)]). + +verify_runtime_deps([], _AppVsnsTab, Res) -> + Res; +verify_runtime_deps([{App, Vsn, IReqs} | SAIs], AppVsnsTab, Res0) -> + Res = lists:foldl( + fun ({IRApp, IRMinVsn} = InstReq, AccRes) -> + case gb_trees:lookup(IRApp, AppVsnsTab) of + none -> + missing_min_req(App, Vsn, InstReq), + false; + {value, AppVsns} -> + try + lists:foreach( + fun (AppVsn) -> + case meets_min_req(AppVsn, IRMinVsn) of + true -> + throw(true); + false -> + false + end + end, + AppVsns), + missing_min_req(App, Vsn, InstReq), + false + catch + throw : true -> + AccRes + end + end + end, + Res0, + IReqs), + verify_runtime_deps(SAIs, AppVsnsTab, Res). + +meets_min_req(Vsn, Vsn) -> + true; +meets_min_req({X}, VsnReq) -> + meets_min_req({X, 0, 0}, VsnReq); +meets_min_req({X, Y}, VsnReq) -> + meets_min_req({X, Y, 0}, VsnReq); +meets_min_req(Vsn, {X}) -> + meets_min_req(Vsn, {X, 0, 0}); +meets_min_req(Vsn, {X, Y}) -> + meets_min_req(Vsn, {X, Y, 0}); +meets_min_req({X, _Y, _Z}, {XReq, _YReq, _ZReq}) when X > XReq -> + true; +meets_min_req({X, Y, _Z}, {X, YReq, _ZReq}) when Y > YReq -> + true; +meets_min_req({X, Y, Z}, {X, Y, ZReq}) when Z > ZReq -> + true; +meets_min_req({_X, _Y, _Z}, {_XReq, _YReq, _ZReq}) -> + false; +meets_min_req(Vsn, VsnReq) -> + gp_meets_min_req(mk_gp_vsn_list(Vsn), mk_gp_vsn_list(VsnReq)). + +gp_meets_min_req([X, Y, Z | _Vs], [X, Y, Z]) -> + true; +gp_meets_min_req([X, Y, Z | _Vs], [XReq, YReq, ZReq]) -> + meets_min_req({X, Y, Z}, {XReq, YReq, ZReq}); +gp_meets_min_req([X, Y, Z | Vs], [X, Y, Z | VReqs]) -> + gp_meets_min_req_tail(Vs, VReqs); +gp_meets_min_req(_Vsn, _VReq) -> + %% Versions on different version branches, i.e., the minimum + %% required functionality is not included in Vsn. + false. + +gp_meets_min_req_tail([V | Vs], [V | VReqs]) -> + gp_meets_min_req_tail(Vs, VReqs); +gp_meets_min_req_tail([], []) -> + true; +gp_meets_min_req_tail([_V | _Vs], []) -> + true; +gp_meets_min_req_tail([V | _Vs], [VReq]) when V > VReq -> + true; +gp_meets_min_req_tail(_Vs, _VReqs) -> + %% Versions on different version branches, i.e., the minimum + %% required functionality is not included in Vsn. + false. + +mk_gp_vsn_list(Vsn) -> + [X, Y, Z | Tail] = tuple_to_list(Vsn), + [X, Y, Z | remove_trailing_zeroes(Tail)]. + +remove_trailing_zeroes([]) -> + []; +remove_trailing_zeroes([0 | Vs]) -> + case remove_trailing_zeroes(Vs) of + [] -> []; + NewVs -> [0 | NewVs] + end; +remove_trailing_zeroes([V | Vs]) -> + [V | remove_trailing_zeroes(Vs)]. |