summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile28
-rw-r--r--RELEASE.md1
-rwxr-xr-xgenerate_app.escript13
-rw-r--r--lib/elixir/Emakefile (renamed from lib/elixir/rebar.config)10
-rw-r--r--lib/elixir/src/elixir.app.src6
5 files changed, 36 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 1f21a60cc..5bca00bd2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-REBAR ?= "$(CURDIR)/rebar"
PREFIX ?= /usr/local
SHARE_PREFIX ?= $(PREFIX)/share
CANONICAL := master/
ELIXIRC := bin/elixirc --verbose --ignore-module-conflict
ERLC := erlc -I lib/elixir/include
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
+GENERATE_APP := $(CURDIR)/generate_app.escript
VERSION := $(strip $(shell cat VERSION))
Q := @
LIBDIR := lib
@@ -16,7 +16,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755
GIT_REVISION = $(strip $(shell git rev-parse HEAD 2> /dev/null ))
GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$head 2> /dev/null | tail -1) )
-.PHONY: install compile erlang elixir build_plt clean_plt dialyze test clean clean_residual_files install_man clean_man docs Docs.zip Precompiled.zip zips
+.PHONY: install compile erlang elixir unicode app build_plt clean_plt dialyze test clean clean_residual_files install_man clean_man docs Docs.zip Precompiled.zip zips
.NOTPARALLEL: compile
#==> Functions
@@ -52,16 +52,20 @@ endef
#==> Compilation tasks
APP := lib/elixir/ebin/elixir.app
-KERNEL:=lib/elixir/ebin/Elixir.Kernel.beam
-UNICODE:=lib/elixir/ebin/Elixir.String.Unicode.beam
+PARSER := lib/elixir/src/elixir_parser.erl
+KERNEL := lib/elixir/ebin/Elixir.Kernel.beam
+UNICODE := lib/elixir/ebin/Elixir.String.Unicode.beam
default: compile
-compile: erlang elixir
+compile: erlang $(APP) elixir
-erlang:
+erlang: $(PARSER)
$(Q) if [ ! -f $(APP) ]; then $(call CHECK_ERLANG_RELEASE); fi
- $(Q) cd lib/elixir && $(REBAR) compile
+ $(Q) cd lib/elixir && mkdir -p ebin && erl -make
+
+$(PARSER): lib/elixir/src/elixir_parser.yrl
+ $(Q) erlc -o $@ +'{versbose,true}' +'{report,true}' $<
# Since Mix depends on EEx and EEx depends on Mix,
# we first compile EEx without the .app file,
@@ -78,8 +82,12 @@ $(KERNEL): lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex lib/elixir/lib/*/*/*.ex
$(Q) cd lib/elixir && ../../$(ELIXIRC) "lib/kernel.ex" -o ebin;
$(Q) cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin;
$(Q) $(MAKE) unicode
- $(Q) rm -f lib/elixir/ebin/elixir.app
- $(Q) cd lib/elixir && $(REBAR) compile
+ $(Q) $(MAKE) app
+
+app: $(APP)
+$(APP): lib/elixir/src/elixir.app.src lib/elixir/ebin VERSION $(GENERATE_APP)
+ @ echo "==> app (compile)";
+ $(Q) $(GENERATE_APP) $< $@ $(VERSION)
unicode: $(UNICODE)
$(UNICODE): lib/elixir/unicode/*
@@ -110,9 +118,9 @@ install: compile
$(MAKE) install_man
clean:
- cd lib/elixir && $(REBAR) clean
rm -rf ebin
rm -rf lib/*/ebin
+ rm -rf $(PARSER)
$(Q) $(MAKE) clean_residual_files
clean_elixir:
diff --git a/RELEASE.md b/RELEASE.md
index 87889c6d0..63686ea3f 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -32,4 +32,3 @@ This document simply outlines the release process:
* VERSION
* CHANGELOG.md
-* lib/elixir/src/elixir.app.src
diff --git a/generate_app.escript b/generate_app.escript
new file mode 100755
index 000000000..208829801
--- /dev/null
+++ b/generate_app.escript
@@ -0,0 +1,13 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+
+main([Source, Target, Version]) ->
+ {ok, [{application, Name, Props0}]} = file:consult(Source),
+ Ebin = filename:dirname(Target),
+ {ok, Files} = file:list_dir(Ebin),
+ Mods = [list_to_atom(filename:basename(F, ".beam")) || F <- Files],
+ Props1 = lists:keyreplace(modules, 1, Props0, {modules, Mods}),
+ Props = lists:keyreplace(vsn, 1, Props1, {vsn, Version}),
+ AppDef = io_lib:format("~tp.~n", [{application, Name, Props}]),
+ ok = file:write_file(Target, AppDef),
+ io:format("Generated ~ts.app~n", [Name]).
diff --git a/lib/elixir/rebar.config b/lib/elixir/Emakefile
index 53ddb65f6..af49f3494 100644
--- a/lib/elixir/rebar.config
+++ b/lib/elixir/Emakefile
@@ -1,4 +1,4 @@
-{erl_opts, [
+{'src/*', [
warn_unused_vars,
warn_export_all,
warn_shadow_vars,
@@ -14,10 +14,6 @@
%% warn_missing_spec,
%% warn_untyped_record,
%% warnings_as_errors,
- debug_info
-]}.
-
-{yrl_opts, [
- {report, true},
- {verbose, false}
+ debug_info,
+ {outdir, "ebin/"}
]}.
diff --git a/lib/elixir/src/elixir.app.src b/lib/elixir/src/elixir.app.src
index 969f3c96c..d45cc5cee 100644
--- a/lib/elixir/src/elixir.app.src
+++ b/lib/elixir/src/elixir.app.src
@@ -1,9 +1,7 @@
{application, elixir,
[{description, "elixir"},
- {vsn, "1.7.0-dev"},
- {modules, [
- elixir
- ]},
+ {vsn, '$will-be-replaced'},
+ {modules, '$will-be-replaced'},
{registered, [elixir_config, elixir_code_server]},
{applications, [kernel,stdlib,compiler]},
{mod, {elixir,[]}},