Skip to content

Commit

Permalink
Makefile: Enhance remote compilation
Browse files Browse the repository at this point in the history
Use git to synchronize with local changes, and compile.
TODO: Both machines must be checkout on the same branch
      (by name)

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Mar 15, 2010
1 parent 0c5efd2 commit a622233
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ osd-target/tests/setattr
# files made by make
osd-target/osd-schema.c
osd-initiator/python/writefile.py
diff_upload.patch
tgt_diff_upload.patch

# kdevelop
tgt.kdevelop
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Top level Makefile to build everything

MK_PATH ?= .
MK_PATH ?= $(PWD)
util := $(MK_PATH)/osd-util
tgt := $(MK_PATH)/tgt
target := $(MK_PATH)/osd-target
Expand Down Expand Up @@ -61,7 +61,22 @@ R_PATH ?= "/fs/home/bharrosh/osc-osd"

.PHONY: remote remote_clean
remote:
ssh $(R) "cd $(R_PATH);gmake MK_PATH=$(R_PATH) -C $(R_PATH)"
git diff --ignore-submodules HEAD > diff_upload.patch
git push -f ssh://$(R)/$(R_PATH) ;
cd tgt; \
git diff HEAD > ../tgt_diff_upload.patch; \
git push -f ssh://$(R)/$(R_PATH)/tgt ; \
cd ..;
scp diff_upload.patch tgt_diff_upload.patch $(R):$(R_PATH)/
ssh $(R) "cd $(R_PATH); git reset --hard HEAD; git apply diff_upload.patch; gmake at_remote;"

at_remote:
git apply diff_upload.patch;
cd tgt; \
git reset --hard HEAD; \
git apply ../tgt_diff_upload.patch; \
cd ..;
gmake MK_PATH=$(R_PATH) -C $(R_PATH)

remote_clean:
ssh $(R) "cd $(R_PATH);gmake MK_PATH=$(R_PATH) -C $(R_PATH) clean"

0 comments on commit a622233

Please sign in to comment.