From 710a34af3bfba481a09dffb1e12cfa086b16a937 Mon Sep 17 00:00:00 2001 From: "Marcus M. Darden" <mmdarden@umich.edu> Date: Tue, 13 Feb 2018 00:52:56 -0500 Subject: [PATCH] Clean up and finalize sync2caen target. --- Makefile | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 4077b4e..029410b 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ debug: clean $(EXECUTABLE) # make profile - will compile "all" with $(CXXFLAGS) and the -pg flag profile: CXXFLAGS += -pg -profile: clean all +profile: clean $(EXECUTABLE) # make static - will perform static analysis in the matter currently used # on the autograder @@ -87,8 +87,8 @@ static: # Build both release and debug executables all: clean - make -Rr release - make debug + $(MAKE) -Rr release + $(MAKE) debug $(EXECUTABLE): $(OBJECTS) ifeq ($(EXECUTABLE), executable) @@ -151,33 +151,18 @@ $(FULL_SUBMITFILE): $(FULL_SUBMITFILES) partialsubmit: $(PARTIAL_SUBMITFILE) fullsubmit: $(FULL_SUBMITFILE) -sync2caen: REMOTE_PATH:="${REMOTE_BASEDIR}/$$(basename `pwd`)" +sync2caen: REMOTE_PATH := ${REMOTE_BASEDIR}/$(notdir $(shell pwd)) sync2caen: - @echo "Build time: `date`" > rsync.log - @-open rsync.log -# Make target directory on CAEN server - @echo "Making remote target directory ... ${REMOTE_PATH}" \ - >> rsync.log - @ssh login.engin.umich.edu "mkdir -p ${REMOTE_PATH}" \ - >> rsync.log -# Synchronize local files into target directory on CAEN - @echo "Synchronizing local files to CAEN ..." \ - >> rsync.log - @rsync \ + # Make target directory on CAEN + ssh login.engin.umich.edu "mkdir -p ${REMOTE_PATH}" + # Synchronize local files into target directory on CAEN + rsync \ -av \ --delete \ --exclude '.git*' \ - --exclude 'rsync.log' \ - --exclude '.DS_Store' \ --filter=":- .gitignore" \ ./ \ - "login.engin.umich.edu:${REMOTE_PATH}/" \ - >> rsync.log -# Do remote builds - @echo "Making remote executables with \"make all\" ..." \ - >> rsync.log - @ssh login.engin.umich.edu "cd ${REMOTE_PATH} && make all" \ - >> rsync.log + "login.engin.umich.edu:${REMOTE_PATH}/" define MAKEFILE_HELP EECS281 Advanced Makefile Help @@ -226,12 +211,12 @@ EECS281 Advanced Makefile Help B) Usage: $$ make static -* Mac to CAEN upload support +* Sync to CAEN support A) Requires an .ssh/config file with a login.engin.umich.edu host defined, SSH Multiplexing enabled, and an open SSH connection. B) Edit the REMOTE_BASEDIR variable if default is not preferred. C) Usage: - $$ make mac2caen + $$ make sync2caen endef export MAKEFILE_HELP -- GitLab