diff --git a/.gitignore b/.gitignore index 3b0db60..d2132df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ priv/ ebin/ *.o +deps/ +rebar +*~ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fc279a6 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +.DEFAULT_GOAL := all + +.PHONY: deps + +REBAR=./rebar + +all: deps compile + +deps: rebar + @$(REBAR) get-deps + +compile: deps rebar + @$(REBAR) compile + +clean: rebar + @$(REBAR) clean + +distclean: rebar clean + @$(REBAR) delete-deps + rm -rf rebar-git + rm rebar + +uninstall: + bash -c "cd deps/wiringPi; sudo ./build uninstall" + +rebar: + mkdir -p deps + git clone https://github.com/rebar/rebar.git deps/rebar + bash -c "cd deps/rebar; ./bootstrap" + cp deps/rebar/rebar . + diff --git a/rebar.config b/rebar.config index 7de2273..55205eb 100644 --- a/rebar.config +++ b/rebar.config @@ -1 +1,12 @@ {port_env, [{"LDFLAGS", "$LDFLAGS -lwiringPi -lwiringPiDev -lpthread"}]}. + +{deps, [ + {wiringPi, ".*", {git, "git://git.drogon.net/wiringPi", {branch, "master"}}, [raw]} + ]}. + + +{deps_dir, "deps"}. +{pre_hooks, [ + {compile, "bash -c 'cd deps/wiringPi; sudo ./build; sudo ldconfig'"} + ]}. + \ No newline at end of file