diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..187312b50d1b366db437fa4a97ebf39362bff591 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +include make_alma_fetch + +SHELL := /bin/bash +py := python3 +os := $(shell uname -s) +home_dir := $(shell pwd) +setup_dirs := $(shell find . -name setup.py | tr '\n' ' ' | sed "s/setup.py//g") + +.PHONY: ${HOME}/miniconda3 clean + +all: miniconda-installed build-python build-alma + +miniconda-installed ${HOME}/miniconda3: + conda env update + +${HOME}/miniconda3: + @url="https://repo.anaconda.com/miniconda/" + if [ "$(os)" == "Darwin" ]; \ + then \ + file="Miniconda3-latest-MacOSX-x86_64.sh"; \ + elif [ "$(os)" == "Linux" ]; \ + then \ + file="Miniconda3-latest-Linux-x86_64.sh"; \ + fi + echo $(addsuffix $(file),$(url)) + wget $(addsuffix $(file),$(url)) -P ${HOME} + chmod +x $$HOME/$$file + $$HOME/$$file + +build-python $(setup_dirs): + @for dir in $(setup_dirs) ; do \ + cd $$dir ; \ + $(py) setup.py develop ; \ + cd $(home_dir) ; \ + done + +clean: + find . -name '*.pyc' -exec rm --force {} + + find . -name '*.pyo' -exec rm --force {} + + find . -name '*~' -exec rm --force {} + + rm -f -R *.egg-info + conda deactivate \ No newline at end of file diff --git a/make_alma_fetch b/make_alma_fetch new file mode 100644 index 0000000000000000000000000000000000000000..54a0a7f9a542f02aeac84e65a474150031b5cd45 --- /dev/null +++ b/make_alma_fetch @@ -0,0 +1,22 @@ +.PHONY: all build-python clean-alma +all: build-alma + +#miniconda-installed: ${HOME}/miniconda3 +# echo "found miniconda3 install" +# +#${HOME}/miniconda3: +# echo "looks like I have to install miniconda" +# touch $@ + +build-alma: apps/cli/executables/alma_product_fetch/dist/alma_product_fetch-4.0.0a1.dev1.macosx-10.9-x86_64.tar.gz + echo "built" + +alma_product_fetch_sources := $(shell find apps/cli/executables/alma_product_fetch -type f) + +apps/cli/executables/alma_product_fetch/dist/alma_product_fetch-4.0.0a1.dev1.macosx-10.9-x86_64.tar.gz: $(alma_product_fetch_sources) + echo building alma product fetch + cd apps/cli/executables/alma_product_fetch && \ + python setup.py bdist + +clean-alma: + rm -f apps/cli/executables/alma_product_fetch/dist/alma_product_fetch-4.0.0a1.dev1.macosx-10.9-x86_64.tar.gz \ No newline at end of file