root/trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile

Revision 478, 4.8 kB (checked in by jdecq, 1 year ago)

Making the link of gm.dylib verbose to help troubleshooting dependencies issues on Mac

Line 
1 #
2 # Flickr Uploadr
3 #
4 # Copyright (c) 2007-2008 Yahoo! Inc.  All rights reserved.  This library is
5 # free software; you can redistribute it and/or modify it under the terms of
6 # the GNU General Public License (GPL), version 2 only.  This library is
7 # distributed WITHOUT ANY WARRANTY, whether express or implied. See the GNU
8 # GPL for more details (http://www.gnu.org/licenses/gpl.html)
9 #
10
11 PLATFORM := $(filter mac ppc linux universal, $(MAKECMDGOALS))
12 COMPONENT := $(filter gm key clh, $(MAKECMDGOALS))
13
14 GECKO_SDK := ../gecko-sdk.$(PLATFORM)/sdk
15 GM_INCLUDE := -I/usr/local/include/GraphicsMagick
16 GM_LIB := -L/usr/local/lib
17 EXIV_INCLUDE := -I/opt/local/include/exiv2
18 EXIV_LIB := -L/usr/local/lib -L/usr/lib
19 FF_INCLUDE := -I/usr/local/include
20 FF_LIB := -L/usr/local/lib
21 X11_LIB := -L/usr/X11R6/lib
22 PORTS_LIB := -L/opt/local/lib
23 XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current
24
25 ifeq (mac, $(PLATFORM))
26 DEFINE := -DXP_UNIX -DXP_MACOSX
27 endif
28 ifeq (ppc, $(PLATFORM))
29 DEFINE := -DXP_UNIX -DXP_MACOSX
30 endif
31 ifeq (linux, $(PLATFORM))
32 DEFINE := -DXP_UNIX
33 endif
34
35 all:
36         @echo "Platform targets:"
37         @echo "  mac (Intel)"
38         @echo "  ppc"
39         @echo "  linux - not implemented"
40         @echo "  universal (combines mac and ppc dylibs using lipo)"
41         @echo "Components:"
42         @echo "  gm"
43         @echo "  key"
44         @echo "  clh"
45         @echo "Mix & match from the above lists to build components for platforms"
46         @echo ""
47         @echo "Usage: make <platform> <component>"
48
49
50
51 mac:
52         @echo "Building for Intel Macs..."
53
54 ppc:
55         @echo "Building for PowerPC Macs..."
56
57 linux:
58         @echo "Building for x86 Linux..."
59
60 universal:
61         @echo "Building Universal Binary for Macs..."
62         lipo -create \
63                 -arch ppc $(COMPONENT).dylib.ppc \
64                 -arch i386 $(COMPONENT).dylib.mac \
65                 -output $(COMPONENT).dylib
66
67
68
69 gm:
70 ifneq (universal, $(PLATFORM))
71         @echo "Building the GraphicsMagick/FFmpeg XPCOM component..."
72 ifeq (mac, $(PLATFORM))
73         @echo "Building the GraphicsMagick/FFmpeg XPT file..."
74         $(GECKO_SDK)/bin/xpidl \
75                 -m header \
76                 -I$(GECKO_SDK)/idl \
77                 flIGM.idl
78         $(GECKO_SDK)/bin/xpidl \
79                 -m typelib \
80                 -I$(GECKO_SDK)/idl \
81                 flIGM.idl
82 endif
83         g++ -w -c -O2 -fshort-wchar \
84                 -o flGM.o \
85                 -I$(GECKO_SDK)/include \
86                 $(GM_INCLUDE) \
87                 $(EXIV_INCLUDE) \
88                 $(FF_INCLUDE) \
89                 $(DEFINE) \
90                 flGM.cpp
91         g++ -w -c -O2 -fshort-wchar \
92                 -o flGMModule.o \
93                 -I$(GECKO_SDK)/include \
94                 $(DEFINE) \
95                 flGMModule.cpp
96         g++ -v -dynamiclib -O2 \
97                 -o gm.dylib.$(PLATFORM) \
98                 flGM.o flGMModule.o \
99                 -L$(GECKO_SDK)/lib \
100                 $(GM_LIB) \
101                 $(PORTS_LIB) \
102                 -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \
103                 -lxpcomglue_s -lxpcom -lnspr4 \
104                 -lGraphicsMagick -lGraphicsMagick++ \
105                 -lexiv2 -liconv -lexpat \
106                 -lz -lbz2 \
107                 -lxml2 \
108                 -ljpeg -lpng -ltiff \
109                 -lavformat -lavcodec -lavutil -lswscale \
110                 -Wl,-read_only_relocs,suppress
111 else
112         @echo "Not building the GraphicsMagick/FFmpeg XPCOM component"
113 endif
114
115
116
117 key:
118 ifneq (universal, $(PLATFORM))
119         @echo "Building the API key XPCOM component..."
120 ifeq (mac, $(PLATFORM))
121         @echo "Building the API key XPT file..."
122         $(GECKO_SDK)/bin/xpidl \
123                 -m header \
124                 -I$(GECKO_SDK)/idl \
125                 flIKey.idl
126         $(GECKO_SDK)/bin/xpidl \
127                 -m typelib \
128                 -I$(GECKO_SDK)/idl \
129                 flIKey.idl
130 endif
131         g++ -w -c -O2 -fshort-wchar\
132                 -o flKey.o \
133                 -I$(GECKO_SDK)/include \
134                 $(DEFINE) \
135                 flKey.cpp
136         g++ -w -c -O2 -fshort-wchar\
137                 -o flKeyModule.o \
138                 -I$(GECKO_SDK)/include \
139                 $(DEFINE) \
140                 flKeyModule.cpp
141         g++ -dynamiclib -O2 \
142                 -o key.dylib.$(PLATFORM) \
143                 flKey.o flKeyModule.o \
144                 -L$(GECKO_SDK)/lib \
145                 -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \
146                 -lxpcomglue_s -lxpcom -lnspr4
147 else
148         @echo "Not building the API key XPCOM component"
149 endif
150
151
152
153 clh:
154         @echo "Building the CLH XPT file..."
155         $(GECKO_SDK)/bin/xpidl \
156                 -m typelib \
157                 -I$(GECKO_SDK)/idl \
158                 flICLH.idl
159
160
161
162 gm_test:
163         g++ -w -c -O2 -o gm_test.o $(GM_INCLUDE) $(EXIV_INCLUDE) gm_test.cpp
164         g++ -O2 -o gm_test gm_test.o \
165                 $(GM_LIB) \
166                 $(PORTS_LIB) \
167                 -lGraphicsMagick++ -lGraphicsMagick \
168                 -lexiv2 -liconv -lexpat \
169                 -lz -lbz2 \
170                 -lxml2 \
171                 -ljpeg -lpng -ltiff
172
173 gm_clean:
174         rm -f gm_test gm_test.o
175
176
177
178 ff_test:
179         g++ -w -c -O2 -o ff_test.o \
180                 $(GM_INCLUDE) $(EXIV_INCLUDE) $(FF_INCLUDE) \
181                 ff_test.cpp
182         g++ -O2 -o ff_test ff_test.o \
183                 $(GM_LIB) \
184                 $(PORTS_LIB) \
185                 -lavformat -lavcodec -lavutil \
186                 -lGraphicsMagick++ -lGraphicsMagick \
187                 -lexiv2 -liconv -lexpat \
188                 -lz -lbz2 \
189                 -lxml2 \
190                 -ljpeg -lpng -ltiff
191
192 ff_clean:
193         rm -f ff_test ff_test.o
194
195
196
197 rotate:
198         g++ -w -c -O2 -o rotate.o $(GM_INCLUDE) $(EXIV_INCLUDE) rotate.cpp
199         g++ -O2 -o rotate rotate.o \
200                 $(GM_LIB) \
201                 $(PORTS_LIB) \
202                 -lGraphicsMagick++ -lGraphicsMagick \
203                 -lexiv2 -liconv -lexpat \
204                 -lz -lbz2 \
205                 -lxml2 \
206                 -ljpeg -lpng -ltiff
207
208 rotate_clean:
209         rm -f rotate rotate.o
Note: See TracBrowser for help on using the browser.