the tags and sync targets
[sfa-gui.git] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..0b4e260
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+# dev targets
+
+tags: 
+       find . -name '*.py' -o -name '*.html' -o -name '*.css' | xargs etags
+
+clean:
+       rm -f TAGS
+
+.PHONY: tags clean
+
+##############################
+# REMOTE is expected to be a ssh url like user@hostname 
+
+LOCAL_RSYNC_EXCLUDES   := --exclude '*.pyc' 
+RSYNC_EXCLUDES         := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
+RSYNC_COND_DRY_RUN     := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
+RSYNC                  := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
+
+sync:
+ifeq (,$(REMOTE))
+       @echo "sync: You must define REMOTE"
+       @echo "  e.g. make sync REMOTE=thierry@sfaui.pl.sophia.inria.fr:SFA-GUI"
+       @exit 1
+else
+       +$(RSYNC) . $(REMOTE)
+endif
+
+.PHONY: sync
+##############################