Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 93 lines (87 sloc) 7.204 kb
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
1 #-*- Makefile -*-
2 #
3 # ${R_HOME}/Makefile.fw
4
5 top_builddir = .
6
7 include $(top_builddir)/Makeconf
8
9 install install-strip: install-R-framework
10 @(sed 's|^LIBR =.*|LIBR = -F$(R_FRAMEWORK_DIR)/.. -framework R|' \
11 $(top_builddir)/etc/Makeconf > "$(rhome)/etc${R_ARCH}/Makeconf")
12 @(sed 's/Versions\/$(FW_VERSION)\/Resources/Resources/' \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
13 "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/R" > \
14 "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/RR")
15 @(mv "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/RR" "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/R")
16 @(chmod a+x "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/R")
17 @(chmod -R g+w "$(DESTDIR)$(R_FRAMEWORK_DIR)")
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
18
19
20 install-R-framework:
21 @$(ECHO) "Creating R framework ..."
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
22 @(cd "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)" && \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
23 ln -f -s -n Resources/include Headers && \
24 ln -f -s -n Resources/lib/libR.dylib R)
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
25 @if [ ! -e "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders" ]; then \
26 mkdir "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/PrivateHeaders"; fi
27 @(cd "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions" && \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
28 ln -f -s -n $(FW_VERSION) Current)
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
29 @(if [ -e "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources" -a ! -L "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources" ]; then \
30 rm -rf "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources.old"; mv "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources" "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources.old"; \
890d702 make sure Resources is a symlink in the framework
urbaneks authored
31 fi)
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
32 @(cd "$(DESTDIR)$(R_FRAMEWORK_DIR)" && \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
33 ln -f -s -n Versions/Current/PrivateHeaders PrivateHeaders&& \
34 ln -f -s -n Versions/Current/Headers Headers&& \
35 ln -f -s -n Versions/Current/R R && \
36 ln -f -s -n Versions/Current/Resources/lib Libraries && \
37 ln -f -s -n Versions/Current/Resources Resources)
38 @## the resulting libR will point dyld to the fat libR regardless of its origin
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
39 @(cd "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/lib" && \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
40 install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(Rexeclibdir)/libR.dylib)
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
41 @( otool=otool ; if otool -D "$(DESTDIR)$(Rexeclibdir)/libR.dylib"|grep 'not an object'>/dev/null; then otool=otool64; fi; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
42 for lib in Rlapack Rblas R; do \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
43 if test -e "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib"; then $(ECHO) " lib$${lib}"; \
44 find "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
45 xargs -n 1 install_name_tool -change \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
46 `$${otool} -L "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib" |sed -n -e '2 s/.\(.*\) (compat.*/\1/p'` \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
47 "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
48 find "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
49 xargs -n 1 install_name_tool -change lib$${lib}.dylib \
50 "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
51 install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
52 "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib"; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
53 if [ "$(Rexeclibdir)" != "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib" ]; then \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
54 $(top_srcdir)/tools/updatefat "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib"; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
55 install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
56 "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib"; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
57 fi; \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
58 for rexe in `ls "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)"/Resources/bin/exec/*/R "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/exec/R" 2>/dev/null`; do \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
59 install_name_tool -change lib$${lib}.dylib \
60 "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$$rexe" ; \
61 done; \
62 fi; \
63 done)
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
64 @(cp -R $(top_srcdir)/src/include/* "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/" && \
65 cp src/include/config.h "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/" && \
66 chmod a+r "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/config.h"; \
67 find "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders" -name .svn | xargs rm -rf)
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
68 @(install_name_tool -change libR.dylib \
69 "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
70 "$(DESTDIR)$(Rexecbindir2)/R")
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
71 @(if [ -n "${R_ARCH}" ]; then \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
72 rm -rf "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}" && \
73 mkdir "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}" && \
74 cp src/include/config.h "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h"; \
75 chmod a+r "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders${R_ARCH}/config.h"; \
76 sed -e "s|R_ARCH=${R_ARCH}|R_ARCH=/\`arch\`|" "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R" \
77 > "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
78 chmod a+x "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" && \
79 mv "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/.tmp.R" "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/bin/R"; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
80 if [ "${R_ARCH}" != /ppc -a "${R_ARCH}" != /i386 -a "${R_ARCH}" != /ppc64 -a "${R_ARCH}" != /x86_64 -a "${R_ARCH}" != /arm ]; then \
81 $(ECHO) "\
82 *** 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; \
83 else \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
84 for f in `ls "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Headers/${R_ARCH}/"*.h|xargs basename` config.h; do \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
85 fn="Headers/$$f"; if [ "$$f" = "config.h" ]; then fn="PrivateHeaders/config.h"; fi; \
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
86 $(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/' > "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/$$fn"; \
fc709ca separate framework-specific stuff to a separate makefile
ripley authored
87 done; \
88 fi; \
89 fi )
52d5c74 add DESTDIR support in Makefile.fw
urbaneks authored
90 @( rm -f "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" && \
91 ln -s bin/R "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/R" )
92 @( $(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/' > "$(DESTDIR)$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/Info.plist")
Something went wrong with that request. Please try again.