[Swift-commit] r4044 - SwiftApps/SwiftR
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Fri Jan 28 15:34:01 CST 2011
Author: tga
Date: 2011-01-28 15:34:01 -0600 (Fri, 28 Jan 2011)
New Revision: 4044
Modified:
SwiftApps/SwiftR/Makefile
Log:
Improved makefile to avoid unnecessary recompilations.
Modified: SwiftApps/SwiftR/Makefile
===================================================================
--- SwiftApps/SwiftR/Makefile 2011-01-28 21:12:17 UTC (rev 4043)
+++ SwiftApps/SwiftR/Makefile 2011-01-28 21:34:01 UTC (rev 4044)
@@ -1,28 +1,31 @@
+# All files that go into package
+PKG_FILES = $(shell find Swift/R -name '*.R'; find Swift/man -name '*.Rd'; find Swift/exec/ -type f -not -path '*/.svn*'; find Swift/inst/ -type f -not -path '*/.svn*')
+
+PKG_FILES += Swift/DESCRIPTION
+
+
# Extract the version number from the R package description file
# There should be a line in the file of the form:
# Version: (major).(minor)
SWIFTR_VERSION=$(shell sed -n -r 's/^Version:(\W*)([[:digit:]]+\.[[:digit:].]+)/\2/p' Swift/DESCRIPTION)
-SW := $(shell which swift)
+SW = $(shell which swift)
+SWD = $(shell dirname $(SW))
+SWIFT_PATH = $(shell cd $(SWD)/..; pwd)
TBALL=Swift_$(SWIFTR_VERSION).tar.gz
all: build
+build: $(TBALL)
-
-build: Swift/inst/swift/bin/swift
- R CMD build Swift
-
# Target to make sure that swift exists
Swift/inst/swift/bin/swift:
- SWD := $(shell dirname $(SW))
- SWIFT_PATH := $(shell cd $(SWD)/..; pwd)
$(if $(SW),, $(error swift could not be found using which))
mkdir -p Swift/inst/swift
- cp -pr $(SWIFT_PATH)/* Swift/inst/swift
+ cp -r $(SWIFT_PATH)/* Swift/inst/swift
publish: $(TBALL)
cp $(TBALL) ~/public_html
@@ -37,8 +40,11 @@
rm -rf Swift/inst/swift/*
rm $(TBALL)
-$(TBALL): build
+$(TBALL): Swift/inst/swift/bin/swift $(PKG_FILES) Makefile
+ R CMD build Swift
+
+
checkversion:
echo SwiftR version is $(SWIFTR_VERSION) according to Swift/DESCRIPTION file
More information about the Swift-commit
mailing list