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:
|
||||
./priv/jsx clean
|
||||
|
||||
install: clean compile
|
||||
./priv/jsx install
|
||||
|
||||
force:
|
13
priv/jsx
13
priv/jsx
|
@ -6,6 +6,8 @@ main(Args) ->
|
|||
; ["examples"|Opts] -> examples(Opts)
|
||||
; ["test"|Opts] -> test(Opts)
|
||||
; ["clean"|Opts] -> clean(Opts)
|
||||
; ["install"|Opts] -> install(Opts)
|
||||
; ["uninstall"|Opts] -> uninstall(Opts)
|
||||
end.
|
||||
|
||||
compile([]) ->
|
||||
|
@ -51,5 +53,16 @@ test(Path) ->
|
|||
clean([]) ->
|
||||
[ 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