Rev 130 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
106 | dmarschall | 1 | This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop |
171 | dmarschall | 2 | Copyright (C) 2003-2019 Toby Thain, toby@telegraphics.com.au |
2 | toby | 3 | |
4 | This program is free software; you can redistribute it and/or modify |
||
5 | it under the terms of the GNU General Public License as published by |
||
6 | the Free Software Foundation; either version 2 of the License, or |
||
7 | (at your option) any later version. |
||
8 | |||
9 | This program is distributed in the hope that it will be useful, |
||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
12 | GNU General Public License for more details. |
||
13 | |||
14 | You should have received a copy of the GNU General Public License |
||
15 | along with this program; if not, write to the Free Software |
||
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
17 | |||
69 | toby | 18 | |
2 | toby | 19 | Building the Filter Foundry plugin for Photoshop |
20 | ------------------------------------------------ |
||
21 | |||
22 | Notes on source code |
||
64 | toby | 23 | -------------------- |
69 | toby | 24 | Source code, makefiles and IDE projects under GPL license are provided |
25 | for MPW (Classic & Carbon PowerPC targets), CodeWarrior 7 |
||
26 | (Classic & Carbon PowerPC, Win32, 68K targets) and mingw32 (Win32 target). |
||
2 | toby | 27 | |
28 | A Photoshop SDK is required (available from Adobe Systems, http://www.adobe.com/). |
||
69 | toby | 29 | The SDK was also distributed with Photoshop 6.0 and earlier. |
2 | toby | 30 | |
69 | toby | 31 | The source has been built with SDK 6.0, CS2 and CS3 beta, but older |
32 | versions can be used. |
||
2 | toby | 33 | (If building with SDK v4, edit 68k.r, carbon.r, classic.r, and PiMI_68k.r |
69 | toby | 34 | to remove references to "PIResDefines.h", "PiPL.r" and "PiMI.r" and replace |
35 | with a single #include "PIGeneral.r"; also remove "fmtCanWriteTransparency" |
||
36 | from PiPL_common.r.) |
||
2 | toby | 37 | |
69 | toby | 38 | Before attempting to build, you must edit the makefiles |
39 | ("FilterFoundry.make" for MPW, "Makefile" for mingw32 or OS X), or change your |
||
40 | CodeWarrior project's access paths, to reflect the SDK's installed location. |
||
2 | toby | 41 | |
69 | toby | 42 | In order to build the Carbon plugin with an SDK prior to version 7.0, |
43 | it is necessary to edit the SDK file :PhotoshopAPI:Resources:PIPL.r |
||
44 | as follows: |
||
2 | toby | 45 | 1. find the line "case CodePowerPC:" |
46 | 2. duplicate the next 15 lines |
||
69 | toby | 47 | 3. in the copy only, change "case CodePowerPC:" to "case CodeCarbonPowerPC:" |
2 | toby | 48 | and change the 5 occurrences of "pwpc" to "ppcb" |
49 | |||
69 | toby | 50 | Photoshop 7.0, CS and CS2 will load Carbon/PEF plugins built in this manner. |
51 | Only CodeWarrior and MPW can build these. |
||
2 | toby | 52 | |
69 | toby | 53 | Photoshop CS2 also supports Mach-O format plugins. For details on how |
54 | these are built, see the Makefile (target "osx"). |
||
55 | |||
56 | Photoshop CS3 supports "universal" (or "fat") plugins having native code |
||
57 | for both PowerPC and Intel architectures. The provided Makefile can build |
||
58 | a "universal" plugin if you have the CS3 "Beta" SDK (use target "fat"). |
||
59 | |||
60 | Note that building Mach-O plugins requires Apple's Developer Tools |
||
61 | be installed (from the DVD that came with your Mac, or download from |
||
62 | http://developer.apple.com/ if you have an ADC login). |
||
63 | |||
64 | |||
2 | toby | 65 | Mac notes |
64 | toby | 66 | --------- |
2 | toby | 67 | The Mac build requires Apple's MoreFiles library, which can be obtained via |
68 | http://developer.apple.com/samplecode/Sample_Code/Files/MoreFiles.htm |
||
69 | |||
70 | Depending on how the source files were extracted, it may be necessary to set |
||
69 | toby | 71 | the correct Mac file types before attempting to build. In MPW, this can |
72 | be done as follows. First set the current directory to the Filter Foundry |
||
73 | source directory, then: |
||
74 | setfile -t TEXT Å.[chrly] Å.make Å.rc ::common:tt:Å ::common:adobeplugin:Å |
||
15 | toby | 75 | This can also be necessary after regenerating y.tab.c and lex.yy.c. |
69 | toby | 76 | These files are generated from the parser and lexical analyser definitions, |
77 | parser.y and lexer.l, by a UNIX Terminal (not MPW!) command such as: |
||
15 | toby | 78 | make y.tab.c lex.yy.c |
2 | toby | 79 | |
69 | toby | 80 | If building with MPW, finished binaries are left in the "debug" directory; |
81 | these are good for testing and debugging, as they can be updated |
||
82 | and re-run without having to re-launch Photoshop. |
||
2 | toby | 83 | |
69 | toby | 84 | The finished binary, which contains executables for Classic and Carbon, |
64 | toby | 85 | is left in the "dist" directory. |
86 | |||
87 | |||
106 | dmarschall | 88 | Windows notes |
89 | ------------- |
||
90 | |||
107 | dmarschall | 91 | BUILDING WITH VISUAL STUDIO: |
92 | |||
106 | dmarschall | 93 | To build with Visual Studio, you have to use nmake. |
130 | dmarschall | 94 | Currently, there is no Visual Studio project file. |
106 | dmarschall | 95 | |
96 | To compile: |
||
97 | 1. First download Flex and Bison from https://sourceforge.net/projects/winflexbison/ |
||
98 | and unpack them on your disk. |
||
99 | 2. Download the Adobe Photoshop SDK from https://www.adobe.com/devnet/photoshop/sdk.html |
||
100 | and unpack it on your disk. |
||
101 | 3. Download the telegraphics common library from http://telegraphics.com.au/svn/common/trunk/ |
||
102 | and unpack it on your disk. |
||
109 | dmarschall | 103 | 4. Adjust paths in the nmake.mak and nmake64.mak files. |
104 | 5. For building the 32 bit plugin: |
||
105 | 5.1 Run "x86 Native Tools Command Promt" from the start menu |
||
106 | 5.2 Navigate to the Filter Foundry dir and run |
||
107 | nmake /f nmake.mak clean |
||
108 | nmake /f nmake.mak |
||
109 | For building the 64 bit plugin: |
||
110 | 5.1 Run "x64 Native Tools Command Promt" from the start menu |
||
111 | 5.2 Navigate to the Filter Foundry dir and run |
||
112 | nmake /f nmake64.mak clean |
||
113 | nmake /f nmake64.mak |
||
130 | dmarschall | 114 | You can use the script vc_make_3264.bat to build both 32- and 64-bit with one click. |
115 | dmarschall | 115 | Please first edit this batch file and adjust the Visual Studio path. |
106 | dmarschall | 116 | |
117 | Troubleshooting: |
||
118 | - If "rc" can't be found, install the Windows 10 SDK, and then copy |
||
119 | C:\Program Files (x86)\Windows Kits\10\bin\...\x64 to C:\Program Files (x86)\Windows Kits\10\bin\x86 |
||
120 | see also https://stackoverflow.com/questions/43847542/rc-exe-no-longer-found-in-vs-2015-command-prompt |
||
121 | - If lex.yy.c can't be found, check the flex command (it generates lex.yy.c) |
||
122 | - If nmake gives the error message "makefile(28) : fatal error U1000: Syntax error: ")" missing in macro invocation" |
||
109 | dmarschall | 123 | then run nmake with the parameter "/f nmake.mak" or "/f nmake64.mak" |
124 | (nmake calls Makefile by default, which is not optimized for nmake) |
||
125 | - If you run into any problems, try "nmake /f nmake.mak clean" followed by "nmake /f nmake.mak", |
||
126 | or for 64 bit: "nmake /f nmake64.mak clean" followed by "nmake /f nmake64.mak" |
||
115 | dmarschall | 127 | It is necessary to run the "clean" command when switching between 32bit and 64 bit building. |
106 | dmarschall | 128 | |
107 | dmarschall | 129 | Most recently tested with Visual C++ 2017 with Adobe Photoshop SDK CC 2017. |
106 | dmarschall | 130 | |
107 | dmarschall | 131 | |
132 | BUILDING WITH OPEN WATCOM: |
||
133 | |||
106 | dmarschall | 134 | To build in Windows with the OpenWatcom IDE, see the wpj |
107 | dmarschall | 135 | subdirectory and notes (README.TXT) kindly provided by Peter Heckert and Daniel Marschall. |
106 | dmarschall | 136 | |
137 | |||
2 | toby | 138 | Development systems |
64 | toby | 139 | ------------------- |
2 | toby | 140 | While a CodeWarrior 7 project is provided, MPW and mingw32 are recommended |
141 | as they produce much smaller executables. |
||
142 | |||
69 | toby | 143 | Mingw32 (http://www.mingw.org/) can be hosted on virtually any UNIX or |
144 | Linux system, or under Windows. |
||
2 | toby | 145 | |
69 | toby | 146 | MPW (http://developer.apple.com/tools/mpw-tools/) runs on PowerPC and |
147 | 68K Macs under Mac OS 9 or earlier, or Classic under OS X. |
||
109 | dmarschall | 148 | |
149 | For Windows, Visual Studio works best (the community edition is even free), |
||
150 | and it can compile the 32-Bit and 64-Bit plugin for Windows. |
||
151 | OpenWatcom can also be used, but only for 32 Bit, and it is officially not |
||
152 | supported by Adobe. |