Skip to content
Browse files

separate framework-specific stuff to a separate makefile

git-svn-id: https://svn.r-project.org/R/trunk@47995 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent b5f3ce8 commit fc709cac8109c1c19b9ec32adc8cc12b0b54d805 ripley committed
Showing with 91 additions and 80 deletions.
  1. +89 −0 Makefile.fw
  2. +2 −80 Makefile.in
View
89 Makefile.fw
@@ -0,0 +1,89 @@
+#-*- Makefile -*-
+#
+# ${R_HOME}/Makefile.fw
+
+top_builddir = .
+
+include $(top_builddir)/Makeconf
+
+install install-strip: install-R-framework
+ @(sed 's|^LIBR =.*|LIBR = -F$(R_FRAMEWORK_DIR)/.. -framework R|' \
+ $(top_builddir)/etc/Makeconf > "$(rhome)/etc${R_ARCH}/Makeconf")
+ @(sed 's/Versions\/$(FW_VERSION)\/Resources/Resources/' \
+ $(R_FRAMEWORK_DIR)/Resources/bin/R > \
+ $(R_FRAMEWORK_DIR)/Resources/bin/RR)
+ @(mv $(R_FRAMEWORK_DIR)/Resources/bin/RR $(R_FRAMEWORK_DIR)/Resources/bin/R)
+ @(chmod a+x $(R_FRAMEWORK_DIR)/Resources/bin/R)
+ @(chmod -R g+w $(R_FRAMEWORK_DIR))
+
+
+install-R-framework:
+ @$(ECHO) "Creating R framework ..."
+ @(cd "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)" && \
+ ln -f -s -n Resources/include Headers && \
+ ln -f -s -n Resources/lib/libR.dylib R)
+ @if [ ! -e "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders" ]; then \
+ mkdir "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders"; fi
+ @(cd "$(R_FRAMEWORK_DIR)/Versions" && \
+ ln -f -s -n $(FW_VERSION) Current)
+ @(cd "$(R_FRAMEWORK_DIR)" && \
+ ln -f -s -n Versions/Current/PrivateHeaders PrivateHeaders&& \
+ ln -f -s -n Versions/Current/Headers Headers&& \
+ ln -f -s -n Versions/Current/R R && \
+ ln -f -s -n Versions/Current/Resources/lib Libraries && \
+ ln -f -s -n Versions/Current/Resources Resources)
+ @## the resulting libR will point dyld to the fat libR regardless of its origin
+ @(cd "$(R_FRAMEWORK_DIR)/Resources/lib" && \
+ install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(Rexeclibdir)/libR.dylib)
+ @( otool=otool ; if otool -D "$(Rexeclibdir)/libR.dylib"|grep 'not an object'>/dev/null; then otool=otool64; fi; \
+ for lib in Rlapack Rblas R; do \
+ if test -e "$(Rexeclibdir)/lib$${lib}.dylib"; then $(ECHO) " lib$${lib}"; \
+ find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
+ xargs -n 1 install_name_tool -change \
+ `$${otool} -L $(Rexeclibdir)/lib$${lib}.dylib |sed -n -e '2 s/.\(.*\) (compat.*/\1/p'` \
+ "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
+ find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
+ xargs -n 1 install_name_tool -change lib$${lib}.dylib \
+ "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
+ install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
+ "$(Rexeclibdir)/lib$${lib}.dylib"; \
+ if [ "$(Rexeclibdir)" != "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib" ]; then \
+ $(top_srcdir)/tools/updatefat "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$(Rexeclibdir)/lib$${lib}.dylib"; \
+ install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
+ "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib"; \
+ fi; \
+ for rexe in `ls "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)"/Resources/bin/exec/*/R "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/exec/R" 2>/dev/null`; do \
+ install_name_tool -change lib$${lib}.dylib \
+ "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$$rexe" ; \
+ done; \
+ fi; \
+ done)
+ @(cp -R $(top_srcdir)/src/include/* $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/ && \
+ cp src/include/config.h $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/ && \
+ chmod a+r $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/config.h; \
+ find $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders -name .svn | xargs rm -rf)
+ @(install_name_tool -change libR.dylib \
+ "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" \
+ $(Rexecbindir2)/R)
+ @(if [ -n "${R_ARCH}" ]; then \
+ rm -rf $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH} && \
+ mkdir $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH} && \
+ cp src/include/config.h $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h; \
+ chmod a+r $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h; \
+ sed -e "s|R_ARCH=${R_ARCH}|R_ARCH=/\`arch\`|" "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R" \
+ > "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
+ chmod a+x "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
+ mv "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R"; \
+ if [ "${R_ARCH}" != /ppc -a "${R_ARCH}" != /i386 -a "${R_ARCH}" != /ppc64 -a "${R_ARCH}" != /x86_64 -a "${R_ARCH}" != /arm ]; then \
+ $(ECHO) "\
+ *** WARNING: The architecture name is incompatible with Apple's naming~ convention. This may prevent applications from using the R~ framework. Please use i386, x86_64, ppc, ppc64 or arm as architecture~ names to allow universal builds."|sed 'y/~/\n/' >&2; \
+ else \
+ for f in `ls "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Headers/${R_ARCH}/"*.h|xargs basename` config.h; do \
+ fn="Headers/$$f"; if [ "$$f" = "config.h" ]; then fn="PrivateHeaders/config.h"; fi; \
+ $(ECHO) "/* This is an automatically generated universal stub for architecture-dependent headers. */~#ifdef __i386__~#include \"i386/$$f\"~#elif defined __ppc__~#include \"ppc/$$f\"~#elif defined __ppc64__~#include \"ppc64/$$f\"~#elif defined __x86_64__~#include \"x86_64/$$f\"~#elif defined __arm__~#include \"arm/$$f\"~#else~#error \"Unsupported architecture.\"~#endif" |sed -e 'y/~/\n/' > "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/$$fn"; \
+ done; \
+ fi; \
+ fi )
+ @( rm -f "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" && \
+ ln -s bin/R "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" )
+ @( $(ECHO) "<?xml version=\"1.0\" encoding=\"UTF-8\"?>~<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">~<plist version=\"1.0\">~<dict>~ <key>CFBundleIdentifier</key>~ <string>org.r-project.R-framework</string>~ <key>CFBundleInfoDictionaryVersion</key>~ <string>6.0</string>~ <key>CFBundleName</key>~ <string>R</string>~ <key>CFBundlePackageType</key>~ <string>FMWK</string>~ <key>CFBundleVersion</key>~ <string>$(VERSION)</string>~</dict>~</plist>" |sed -e 'y/~/\n/' > $(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/Info.plist)
View
82 Makefile.in
@@ -14,7 +14,7 @@ INSTFILES = COPYING NEWS
NON_SVN_INSTFILES = SVN-REVISION
DISTFILES = $(INSTFILES) \
ChangeLog INSTALL ONEWS OONEWS README VERSION \
- Makeconf.in Makefile.in \
+ Makeconf.in Makefile.in Makefile.fw \
config.site configure configure.ac
SUBDIRS = m4 tools doc etc share src tests @USE_NLS_TRUE@ po
SUBDIRS_WITH_NO_BUILD = @USE_NLS_FALSE@ po
@@ -85,15 +85,7 @@ install install-strip: installdirs svnonly
@for f in $(NON_SVN_INSTFILES); do \
$(INSTALL_DATA) $${f} "$(DESTDIR)$(rhome)"; \
done
-@WANT_R_FRAMEWORK_TRUE@ $(MAKE) install-R-framework
-@WANT_R_FRAMEWORK_TRUE@ @(sed 's|^LIBR =.*|LIBR = -F$(R_FRAMEWORK_DIR)/.. -framework R|' \
-@WANT_R_FRAMEWORK_TRUE@ $(top_builddir)/etc/Makeconf > "$(rhome)/etc${R_ARCH}/Makeconf")
-@WANT_R_FRAMEWORK_TRUE@ @(sed 's/Versions\/$(FW_VERSION)\/Resources/Resources/' \
-@WANT_R_FRAMEWORK_TRUE@ $(R_FRAMEWORK_DIR)/Resources/bin/R > \
-@WANT_R_FRAMEWORK_TRUE@ $(R_FRAMEWORK_DIR)/Resources/bin/RR)
-@WANT_R_FRAMEWORK_TRUE@ @(mv $(R_FRAMEWORK_DIR)/Resources/bin/RR $(R_FRAMEWORK_DIR)/Resources/bin/R)
-@WANT_R_FRAMEWORK_TRUE@ @(chmod a+x $(R_FRAMEWORK_DIR)/Resources/bin/R)
-@WANT_R_FRAMEWORK_TRUE@ @(chmod -R g+w $(R_FRAMEWORK_DIR))
+@WANT_R_FRAMEWORK_TRUE@ $(MAKE) -f $(srcdir)/Makefile.fw top_srcdir=$(top_srcdir) $@
svnonly:
@if test ! -f "$(srcdir)/doc/FAQ" || test -f non-tarball ; then \
@@ -222,75 +214,5 @@ check check-devel check-all:
reset-recommended:
@(cd src/library/Recommended && $(MAKE) clean)
-install-R-framework:
- @$(ECHO) "Creating R framework ..."
- @(cd "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)" && \
- ln -f -s -n Resources/include Headers && \
- ln -f -s -n Resources/lib/libR.dylib R)
- @if [ ! -e "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders" ]; then \
- mkdir "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders"; fi
- @(cd "$(R_FRAMEWORK_DIR)/Versions" && \
- ln -f -s -n $(FW_VERSION) Current)
- @(cd "$(R_FRAMEWORK_DIR)" && \
- ln -f -s -n Versions/Current/PrivateHeaders PrivateHeaders&& \
- ln -f -s -n Versions/Current/Headers Headers&& \
- ln -f -s -n Versions/Current/R R && \
- ln -f -s -n Versions/Current/Resources/lib Libraries && \
- ln -f -s -n Versions/Current/Resources Resources)
- @## the resulting libR will point dyld to the fat libR regardless of its origin
- @(cd "$(R_FRAMEWORK_DIR)/Resources/lib" && \
- install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(Rexeclibdir)/libR.dylib)
- @( otool=otool ; if otool -D "$(Rexeclibdir)/libR.dylib"|grep 'not an object'>/dev/null; then otool=otool64; fi; \
- for lib in Rlapack Rblas R; do \
- if test -e "$(Rexeclibdir)/lib$${lib}.dylib"; then $(ECHO) " lib$${lib}"; \
- find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
- xargs -n 1 install_name_tool -change \
- `$${otool} -L $(Rexeclibdir)/lib$${lib}.dylib |sed -n -e '2 s/.\(.*\) (compat.*/\1/p'` \
- "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
- find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
- xargs -n 1 install_name_tool -change lib$${lib}.dylib \
- "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
- install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
- "$(Rexeclibdir)/lib$${lib}.dylib"; \
- if [ "$(Rexeclibdir)" != "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib" ]; then \
- $(srcdir)/tools/updatefat "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$(Rexeclibdir)/lib$${lib}.dylib"; \
- install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
- "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib"; \
- fi; \
- for rexe in `ls "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)"/Resources/bin/exec/*/R "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/exec/R" 2>/dev/null`; do \
- install_name_tool -change lib$${lib}.dylib \
- "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$$rexe" ; \
- done; \
- fi; \
- done)
- @(cp -R $(srcdir)/src/include/* $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/ && \
- cp src/include/config.h $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/ && \
- chmod a+r $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/config.h; \
- find $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders -name .svn | xargs rm -rf)
- @(install_name_tool -change libR.dylib \
- "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" \
- $(Rexecbindir2)/R)
- @(if [ -n "${R_ARCH}" ]; then \
- rm -rf $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH} && \
- mkdir $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH} && \
- cp src/include/config.h $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h; \
- chmod a+r $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h; \
- sed -e "s|R_ARCH=${R_ARCH}|R_ARCH=/\`arch\`|" "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R" \
- > "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
- chmod a+x "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
- mv "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R"; \
- if [ "${R_ARCH}" != /ppc -a "${R_ARCH}" != /i386 -a "${R_ARCH}" != /ppc64 -a "${R_ARCH}" != /x86_64 -a "${R_ARCH}" != /arm ]; then \
- $(ECHO) "\
- *** WARNING: The architecture name is incompatible with Apple's naming~ convention. This may prevent applications from using the R~ framework. Please use i386, x86_64, ppc, ppc64 or arm as architecture~ names to allow universal builds."|sed 'y/~/\n/' >&2; \
- else \
- for f in `ls "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Headers/${R_ARCH}/"*.h|xargs basename` config.h; do \
- fn="Headers/$$f"; if [ "$$f" = "config.h" ]; then fn="PrivateHeaders/config.h"; fi; \
- $(ECHO) "/* This is an automatically generated universal stub for architecture-dependent headers. */~#ifdef __i386__~#include \"i386/$$f\"~#elif defined __ppc__~#include \"ppc/$$f\"~#elif defined __ppc64__~#include \"ppc64/$$f\"~#elif defined __x86_64__~#include \"x86_64/$$f\"~#elif defined __arm__~#include \"arm/$$f\"~#else~#error \"Unsupported architecture.\"~#endif" |sed -e 'y/~/\n/' > "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/$$fn"; \
- done; \
- fi; \
- fi )
- @( rm -f "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" && \
- ln -s bin/R "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" )
- @( $(ECHO) "<?xml version=\"1.0\" encoding=\"UTF-8\"?>~<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">~<plist version=\"1.0\">~<dict>~ <key>CFBundleIdentifier</key>~ <string>org.r-project.R-framework</string>~ <key>CFBundleInfoDictionaryVersion</key>~ <string>6.0</string>~ <key>CFBundleName</key>~ <string>R</string>~ <key>CFBundlePackageType</key>~ <string>FMWK</string>~ <key>CFBundleVersion</key>~ <string>$(VERSION)</string>~</dict>~</plist>" |sed -e 'y/~/\n/' > $(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/Info.plist)
TAGS:

0 comments on commit fc709ca

Please sign in to comment.
Something went wrong with that request. Please try again.