added install target to makefile, stages into code:lib_dir()
This commit is contained in:
parent
a6990152b3
commit
c2f8d4e6a0
2 changed files with 17 additions and 1 deletions
3
makefile
3
makefile
|
@ -10,4 +10,7 @@ examples: force
|
||||||
clean:
|
clean:
|
||||||
./priv/jsx clean
|
./priv/jsx clean
|
||||||
|
|
||||||
|
install: clean compile
|
||||||
|
./priv/jsx install
|
||||||
|
|
||||||
force:
|
force:
|
15
priv/jsx
15
priv/jsx
|
@ -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).
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue