Commits

Shian Wu committed dcb87f2

refine

  • Participants
  • Parent commits d53b002

Comments (0)

Files changed (2)

 #
-# Makefile for erlang/rebar
-# last update: 2012-01-16 
+# Makefile for erlang/rebar 
 #
 
-.PHONY: deps test
+REBAR := ./rebar
 
-all: deps compile
+.PHONY: all deps doc test clean release
 
-compile:
-	./rebar compile
+all: deps
+	$(REBAR) compile
 
 dev:
-	./rebar skip_deps=true compile
+	$(REBAR) skip_deps=true compile
 
 deps:
-	./rebar get-deps
+	$(REBAR) get-deps
 
 update:
-	./rebar update-deps
+	$(REBAR) update-deps
 
 clean:
-	./rebar clean
+	$(REBAR) clean
 
 distclean: clean
-	./rebar delete-deps
+	$(REBAR) delete-deps
 
-docs:
-	./rebar skip_deps=true doc
+doc:
+	$(REBAR) skip_deps=true doc
 
-test: all
-	./rebar skip_deps=true eunit
+test:
+	$(REBAR) skip_deps=true eunit
+
+release: all test
+	dialyzer --src src/*.erl deps/*/src/*.erl
 
 shell:
 	erl -pa $(shell pwd)/ebin $(wildcard deps/*/ebin) -config dev.config
 %% == Core ==
 
 %% Additional library directories to add to the code path
-{lib_dirs, []}.
+%%{lib_dirs, []}.
 
 %% == Erlang Compiler ==
 
 %% Erlang files to compile before the rest. Rebar automatically compiles
 %% parse_transforms and custom behaviours before anything other than the files
 %% in this list.
-{erl_first_files, ["mymib1", "mymib2"]}.
+%%{erl_first_files, ["mymib1", "mymib2"]}.
 
 %% Erlang compiler options
-{erl_opts, [no_debug_info, {i, "myinclude"}, {src_dirs, ["src1", "src2"]},
-            {platform_define,
-            "(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
-            {platform_define, "(linux|freebsd)", 'BACKLOG', 128},
-            {platform_define, "R13", 'old_inets'}]}.
+%%{erl_opts, [no_debug_info, {i, "myinclude"}, {src_dirs, ["src1", "src2"]},
+%%            {platform_define,
+%%            "(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
+%%            {platform_define, "(linux|freebsd)", 'BACKLOG', 128},
+%%            {platform_define, "R13", 'old_inets'}]}.
 
 %% MIB Options?
-{mib_opts, []}.
+%%{mib_opts, []}.
 
 %% SNMP mibs to compile first?
-{mib_first_files, []}.
+%%{mib_first_files, []}.
 
 %% == EDoc ==
 
 %% EDoc options
-{edoc_opts, []}.
+%%{edoc_opts, []}.
 
 %% == Port Compiler ==
 
 %% consisting of a regular expression to be applied against the system
 %% architecture and a list of filenames or wildcards to include should the
 %% expression pass. Default is `"c_src/*.c"'
-{port_sources, ["c_src/*.c", {"R14", ["c_src/*.c"]}]}.
+%%{port_sources, ["c_src/*.c", {"R14", ["c_src/*.c"]}]}.
 
 %% Port compilation environment variables. See rebar_port_compiler.erl for
 %% more info. Default is `[]'
-{port_envs, []}.
+%%{port_envs, []}.
 
 %% Custom name of the port driver .so file. Defaults to `<Application>_drv.so'.
-{so_name, "driver.so"}.
+%%{so_name, "driver.so"}.
 
 %% so_specs - useful for building multiple *.so files
 %%            from one or more object files
-{so_specs, [{"priv/so_name.so", ["c_src/object_file_name.o"]}]}.
+%%{so_specs, [{"priv/so_name.so", ["c_src/object_file_name.o"]}]}.
 
 %% == LFE Compiler ==
 
 %% LFE files to compile before the rest
-{lfe_first_files, []}.
+%%{lfe_first_files, []}.
 
 %% Options for the LFE compiler: reuse {erl_opts, []}
 
 %% == ErlyDTL Compiler ==
 
 %% Options for the ErlyDTL compiler
-{erlydtl_opts, []}.
+%%{erlydtl_opts, []}.
 
 %% == EUnit ==
 
 %% Options for eunit:test()
-{eunit_opts, []}.
+%%{eunit_opts, []}.
 
 %% Additional compile options for eunit. erl_opts from above is also used
-{eunit_compile_opts, []}.
+%%{eunit_compile_opts, []}.
 
 %% Same as erl_first_files, but used only when running 'eunit'
-{eunit_first_files, []}.
+%%{eunit_first_files, []}.
 
 %% Whether to enable coverage reporting. Default is `false'
-{cover_enabled, false}.
+%%{cover_enabled, false}.
 
 %% Whether to print coverage report to console. Default is `false'
-{cover_print_enabled, false}.
+%%{cover_print_enabled, false}.
 
 %% == Common Test ==
 
 %% Override the default "test" directory in which SUITEs are located
-{ct_dir, "itest"}.
+%%{ct_dir, "itest"}.
 
 %% Option to pass extra parameters when launching Common Test
-{ct_extra_params, "-boot start_sasl -s myapp"}.
+%%{ct_extra_params, "-boot start_sasl -s myapp"}.
 
 %% == Cleanup ==
 
 %% Which files to cleanup
-{clean_files, ["file", "file2"]}.
+%%{clean_files, ["file", "file2"]}.
 
 %% == Reltool ==
 
 %% Target directory for the release
-{target, "target"}.
+%%{target, "target"}.
 
 %% == OTP Applications ==
 
 %% Binaries to link into the erlang path?
-{app_bin, []}.
+%%{app_bin, []}.
 
 %% Enable validation of the OTP app module list. Default is 'true'
-{validate_app_modules, true}.
+%%{validate_app_modules, true}.
 
 %% == Dependencies ==
 
 %% Where to put any downloaded dependencies. Default is "deps"
-{deps_dir, "deps"}.
+%%{deps_dir, "deps"}.
 
 %% What dependencies we have, dependencies can be of 3 forms, an application
 %% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
 %% an application name, a version and the SCM details on how to fetch it (SCM
 %% type, location and revision). Rebar currently supports git, hg, bzr and svn.
-{deps, [application_name,
-        {application_name, "1.0.*"},
-        {application_name, "1.0.*",
-         {git, "git://github.com/basho/rebar.git", {branch, "master"}}}]}.
+%%{deps, [application_name,
+%%        {application_name, "1.0.*"},
+%%        {application_name, "1.0.*",
+%%         {git, "git://github.com/basho/rebar.git", {branch, "master"}}}]}.
 
 %% == Subdirectories ==
 
 %% Subdirectories?
-{sub_dirs, ["dir1", "dir2"]}.
+%%{sub_dirs, ["dir1", "dir2"]}.
 
 %% == Plugins ==
 
 %% These can include any module on the code path, including deps.
 %% Alternatively, plugins can be placed as source files in the plugin_dir, in
 %% which case they will be compiled and loaded dynamically at runtime.
-{plugins, [plugin1, plugin2]}.
+%%{plugins, [plugin1, plugin2]}.
 
 %% Override the directory in which plugin sources can be found.
 %% Defaults to ./plugins
-{plugin_dir, "some_other_directory"}.
+%%{plugin_dir, "some_other_directory"}.
 
 
 %% == Pre/Post Command Hooks ==
 
-{pre_hooks, [{clean, "./prepare_package_files.sh"},
-             {"linux", compile, "c_src/build_linux.sh"},
-             {compile, "escript generate_headers"},
-             {compile, "escript check_headers"}]}.
+%%{pre_hooks, [{clean, "./prepare_package_files.sh"},
+%%             {"linux", compile, "c_src/build_linux.sh"},
+%%             {compile, "escript generate_headers"},
+%%             {compile, "escript check_headers"}]}.
 
-{post_hooks, [{clean, "touch file1.out"},
-              {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
-              {eunit, "touch file2.out"},
-              {compile, "touch postcompile.out"}]}.
+%%{post_hooks, [{clean, "touch file1.out"},
+%%              {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
+%%              {eunit, "touch file2.out"},
+%%              {compile, "touch postcompile.out"}]}.
 
 %% == xref ==
 
-{xref_warnings, false}.
+%%{xref_warnings, false}.
 %% xref checks to run
-{xref_checks, [exports_not_used, undefined_function_calls]}.
+%%{xref_checks, [exports_not_used, undefined_function_calls]}.
 
 %% == EScript ==
 
 %% lists applications whose beam files should also be bundled into the archive 
-{escript_incl_apps, []}.
+%%{escript_incl_apps, []}.
 
 %% allows you to pass custom emulator arguments to the generated escript/archive 
-{escript_emu_args, "%%! \n"}.
+%%{escript_emu_args, "%%! \n"}.
 
 %% adds a custom shebang to the generated escript/archive 
-(escript_shebang, ""}.
+%%(escript_shebang, ""}.