#!/usr/bin/env escript
%% -*- erlang -*-
-mode(compile).
%% We print out a warning for files that take longer than
%% ?LONG_COMPILE_THRESHOLD milliseconds to compile.
-define(LONG_COMPILE_THRESHOLD, 10000).
main(Args0) ->
DefOpts = #{erltop=>false,format=>asm,no_compile=>false,
legacy=>false,copts=>[]},
{Args,Opts} = opts(Args0, DefOpts),
case Args of
[OutDir] ->
do_compile(OutDir, Opts);
_ ->
usage()
end.
usage() ->
S = ["usage: otp-diffable-asm [OPTION] DIRECTORY\n\n"
"Options:\n"
" --asm Output to .S files (default)\n"
" --legacy-asm Output to legacy .S files\n"
" --dis Output to .dis files\n"
" --no-compile Disassemble from BEAM files (use with --dis)\n"
" --deterministic Compile with +deterministic (useful when\n"
" comparing output from different build trees using\n"
" --asm)\n"
" --co