Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 638e5e3

Browse files
committed
Added targets to install the application, and to install mac-additions
in Python.
1 parent 745e366 commit 638e5e3

1 file changed

Lines changed: 113 additions & 1 deletion

File tree

Mac/OSX/Makefile

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
PYTHONBUILDDIR=../..
2+
INSTALLDIR=/Library/Frameworks/Python.framework/Versions/Current
3+
APPINSTALLDIR=/Applications/Python.app
24

5+
# Items more-or-less copied from the main Makefile
6+
DIRMODE=755
7+
INSTALL=/usr/bin/install -c
8+
INSTALL_PROGRAM=${INSTALL}
9+
INSTALL_SCRIPT= ${INSTALL_PROGRAM}
10+
INSTALL_DATA= ${INSTALL} -m 644
311
OPT=-g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -fno-common -dynamic
412
INCLUDES=-I$(PYTHONBUILDDIR) -I$(PYTHONBUILDDIR)/Include \
513
-I$(PYTHONBUILDDIR)/Mac/Include
@@ -15,4 +23,108 @@ OBJECTS=$(PYTHONBUILDDIR)/Mac/Python/macmain.o \
1523
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o
1624

1725
pythonforbundle: $(OBJECTS)
18-
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
26+
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
27+
28+
APPTEMPLATE=$(PYTHONBUILDDIR)/Mac/OSXResources/app
29+
APPSUBDIRS=MacOS Resources Resources/English.lproj
30+
install: pythonforbundle
31+
@for i in $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
32+
if test ! -d $$i; then \
33+
echo "Creating directory $$i"; \
34+
$(INSTALL) -d -m $(DIRMODE) $$i; \
35+
fi;\
36+
done
37+
@for i in $(APPSUBDIRS); do \
38+
if test ! -d $(APPINSTALLDIR)/Contents/$$i; then \
39+
echo "Creating directory $(APPINSTALLDIR)/Contents/$$i"; \
40+
$(INSTALL) -d -m $(DIRMODE) $(APPINSTALLDIR)/Contents/$$i; \
41+
else true; \
42+
fi; \
43+
done
44+
@for d in . $(APPSUBDIRS); \
45+
do \
46+
a=$(APPTEMPLATE)/$$d; \
47+
if test ! -d $$a; then continue; else true; fi; \
48+
b=$(APPINSTALLDIR)/Contents/$$d; \
49+
for i in $$a/*; \
50+
do \
51+
echo jaja $$i; \
52+
case $$i in \
53+
*CVS) ;; \
54+
*.py[co]) ;; \
55+
*.orig) ;; \
56+
*~) ;; \
57+
*) \
58+
if test -d $$i; then continue; fi; \
59+
if test -x $$i; then \
60+
echo $(INSTALL_SCRIPT) $$i $$b; \
61+
$(INSTALL_SCRIPT) $$i $$b; \
62+
else \
63+
echo $(INSTALL_DATA) $$i $$b; \
64+
$(INSTALL_DATA) $$i $$b; \
65+
fi;; \
66+
esac; \
67+
done; \
68+
done
69+
$(INSTALL_PROGRAM) pythonforbundle $(APPINSTALLDIR)/Contents/MacOS/python
70+
echo Need to install resources
71+
72+
LIBDEST=$(INSTALLDIR)/Mac/Lib
73+
LIBSRC=$(PYTHONBUILDDIR)/Mac/Lib
74+
LIBSUBDIRS=Carbon lib-scriptpackages lib-scriptpackages/CodeWarrior lib-scriptpackages/Explorer \
75+
lib-scriptpackages/Finder lib-scriptpackages/Netscape lib-scriptpackages/StdSuites \
76+
mkcwproject mkcwproject/template mkcwproject/template-carbon mkcwproject/template-ppc
77+
installmacsubtree:
78+
@for i in $(LIBDEST); \
79+
do \
80+
if test ! -d $$i; then \
81+
echo "Creating directory $$i"; \
82+
$(INSTALL) -d -m $(DIRMODE) $$i; \
83+
else true; \
84+
fi; \
85+
done
86+
@for d in $(LIBSUBDIRS); \
87+
do \
88+
a=$(LIBSRC)/$$d; \
89+
if test ! -d $$a; then continue; else true; fi; \
90+
b=$(LIBDEST)/$$d; \
91+
if test ! -d $$b; then \
92+
echo "Creating directory $$b"; \
93+
$(INSTALL) -d -m $(DIRMODE) $$b; \
94+
else true; \
95+
fi; \
96+
done
97+
@for i in $(LIBSRC)/*.py $(LIBSRC)/*.rsrc; \
98+
do \
99+
if test -x $$i; then \
100+
$(INSTALL_SCRIPT) $$i $(LIBDEST); \
101+
echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
102+
else \
103+
$(INSTALL_DATA) $$i $(LIBDEST); \
104+
echo $(INSTALL_DATA) $$i $(LIBDEST); \
105+
fi; \
106+
done
107+
@for d in $(LIBSUBDIRS); \
108+
do \
109+
a=$(LIBSRC)/$$d; \
110+
if test ! -d $$a; then continue; else true; fi; \
111+
b=$(LIBDEST)/$$d; \
112+
for i in $$a/*; \
113+
do \
114+
case $$i in \
115+
*CVS) ;; \
116+
*.py[co]) ;; \
117+
*.orig) ;; \
118+
*~) ;; \
119+
*) \
120+
if test -d $$i; then continue; fi; \
121+
if test -x $$i; then \
122+
echo $(INSTALL_SCRIPT) $$i $$b; \
123+
$(INSTALL_SCRIPT) $$i $$b; \
124+
else \
125+
echo $(INSTALL_DATA) $$i $$b; \
126+
$(INSTALL_DATA) $$i $$b; \
127+
fi;; \
128+
esac; \
129+
done; \
130+
done

0 commit comments

Comments
 (0)