From cda9f5c4caefca7d4bc88b6d6b602db58b3380b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 27 Sep 2017 21:32:08 +0200 Subject: [PATCH 1/2] Updated makefiles from senpy --- README.md | 27 +++++++++++++++++++++++++++ makefiles.mk | 14 ++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 README.md create mode 100644 makefiles.mk diff --git a/README.md b/README.md new file mode 100644 index 0000000..e025233 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +These makefiles are recipes for several common tasks in different types of projects. +To add them to your project, simply do: + +``` +git remote add makefiles ssh://git@lab.cluster.gsi.dit.upm.es:2200/docs/templates/makefiles.git +git subtree add --prefix=.makefiles/ makefiles master +touch Makefile +echo "include .makefiles/makefiles.mk" >> Makefile +``` + +Now you can take advantage of the recipes. +For instance, to add useful targets for a python project, just add this to your Makefile: + +``` +include .makefiles/python.mk +``` + +You may need to set special variables like the name of your project or the python versions you're targetting. +Take a look at each specific `.mk` file for more information, and the `Makefile` in the [senpy](https://lab.cluster.gsi.dit.upm.es/senpy/senpy) project for a real use case. + +If you update the makefiles from your repository, make sure to push the changes for review in upstream (this repository): + +``` +make makefiles-push +``` + +It will automatically commit all unstaged changes in the .makefiles folder. diff --git a/makefiles.mk b/makefiles.mk new file mode 100644 index 0000000..0589458 --- /dev/null +++ b/makefiles.mk @@ -0,0 +1,14 @@ +makefiles-remote: + git remote add makefiles ssh://git@lab.cluster.gsi.dit.upm.es:2200/docs/templates/makefiles.git || true + +makefiles-commit: makefiles-remote + git add -f .makefiles + git commit -em "Updated makefiles from ${NAME}" + +makefiles-push: makefiles-commit + git subtree push --prefix=.makefiles/ makefiles $(NAME) + +makefiles-pull: makefiles-remote + git subtree pull --prefix=.makefiles/ makefiles master --squash + +.PHONY:: makefiles-remote makefiles-commit makefiles-push makefiles-pull From 7444aa7ec82dec8bac284d268ef27303ce48082a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 27 Sep 2017 21:43:54 +0200 Subject: [PATCH 2/2] Updated makefiles from senpy --- makefiles.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles.mk b/makefiles.mk index 0589458..4bee03b 100644 --- a/makefiles.mk +++ b/makefiles.mk @@ -5,7 +5,7 @@ makefiles-commit: makefiles-remote git add -f .makefiles git commit -em "Updated makefiles from ${NAME}" -makefiles-push: makefiles-commit +makefiles-push: git subtree push --prefix=.makefiles/ makefiles $(NAME) makefiles-pull: makefiles-remote