forked from mbarbon/mac-perl-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 1.69 KB
/
Makefile
File metadata and controls
69 lines (56 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/make -f
# TODO
# - copy info strings
# - copy all resource files
# - rename executable, icon in Info.plist
BUNDLE=PerlWrapper
ICON_FILE=PerlWrapperApp
PERL=/usr/bin/perl
OSX_SDK=10.4u
OSX_VERSION=10.4
ARCHITECTURES=-arch i386 -arch ppc
BUNDLE_DIR=build/$(BUNDLE).app
BUNDLE_CONTENTS=build/$(BUNDLE).app/Contents
BUNDLE_RESOURCES=build/$(BUNDLE).app/Contents/Resources
BUNDLE_BIN=build/$(BUNDLE).app/Contents/MacOS
BUNDLE_DIRS= \
$(BUNDLE_CONTENTS) \
$(BUNDLE_RESOURCES) \
$(BUNDLE_BIN) \
$(BUNDLE_RESOURCES)/Perl-Source \
$(BUNDLE_RESOURCES)/Perl-Libraries \
$(BUNDLE_RESOURCES)/Libraries
BUNDLE_FILES= \
$(BUNDLE_CONTENTS)/Info.plist \
$(BUNDLE_RESOURCES)/$(ICON_FILE).icns \
$(BUNDLE_BIN)/$(BUNDLE)
C_SOURCES= \
Source/PerlInterpreter.c \
Source/main.c
C_HEADERS= \
Source/PerlInterpreter.h
all: bundle
bundle: $(BUNDLE_DIRS) $(BUNDLE_FILES) fix_dylibs
cp -pPRf Perl-Libraries/ $(BUNDLE_RESOURCES)/Perl-Libraries
cp -pPRf Libraries/ $(BUNDLE_RESOURCES)/Libraries
cp -pPRf Perl-Resources/ $(BUNDLE_RESOURCES)
cp -pPRf Perl-Source/ $(BUNDLE_RESOURCES)/Perl-Source
fix_dylibs:
cd Tools && perl update_dylib_references.pl
# resources
$(BUNDLE_CONTENTS)/Info.plist: Info.plist
cp -f $< $@
$(BUNDLE_RESOURCES)/$(ICON_FILE).icns: Resources/$(ICON_FILE).icns
cp -f $< $@
# application
$(BUNDLE_BIN)/$(BUNDLE): $(C_SOURCES) $(C_HEADERS)
$(CC) $(C_SOURCES) $(ARCHITECTURES) -I"Source" -Wall -o $@ \
`$(PERL) ./Tools/embed_flags.pl` \
-isysroot /Developer/SDKs/MacOSX$(OSX_SDK).sdk \
-mmacosx-version-min=$(OSX_VERSION) \
-framework CoreFoundation -framework CoreServices
# directories
$(BUNDLE_DIRS):
for i in $(BUNDLE_DIRS); do \
mkdir -p $$i; \
done