added install target to makefile, stages into code:lib_dir()

This commit is contained in:
alisdair sullivan 2010-06-07 17:55:13 -07:00
parent a6990152b3
commit c2f8d4e6a0
2 changed files with 17 additions and 1 deletions

View file

@ -10,4 +10,7 @@ examples: force
clean: clean:
./priv/jsx clean ./priv/jsx clean
install: clean compile
./priv/jsx install
force: force:

View file

@ -6,6 +6,8 @@ main(Args) ->
; ["examples"|Opts] -> examples(Opts) ; ["examples"|Opts] -> examples(Opts)
; ["test"|Opts] -> test(Opts) ; ["test"|Opts] -> test(Opts)
; ["clean"|Opts] -> clean(Opts) ; ["clean"|Opts] -> clean(Opts)
; ["install"|Opts] -> install(Opts)
; ["uninstall"|Opts] -> uninstall(Opts)
end. end.
compile([]) -> compile([]) ->
@ -50,6 +52,17 @@ test(Path) ->
clean([]) -> clean([]) ->
[ file:delete(Filename) || Filename <- filelib:wildcard("ebin/*.beam") ]. [ file:delete(Filename) || Filename <- filelib:wildcard("ebin/*.beam") ].
install([]) ->
os:cmd("mkdir -p " ++ appdir()),
os:cmd("cp -r " ++ "ebin " ++ appdir()).
uninstall([]) ->
os:cmd("rm -rf " ++ appdir()).
appdir() ->
{ok, [{application, jsx, AppInfo}]} = file:consult("ebin/jsx.app"),
code:lib_dir() ++ "/jsx-" ++ proplists:get_value(vsn, AppInfo).