Subversion Repositories filter_foundry

Rev

Rev 177 | 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
186 dmarschall 68
https://developer.apple.com/library/archive/samplecode/MoreFiles/
2 toby 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
 
172 dmarschall 91
BUILDING WITH VISUAL STUDIO
92
(Most recently tested with Visual C++ 2017 with Adobe Photoshop SDK CC 2017):
107 dmarschall 93
 
172 dmarschall 94
	1. First download Flex and Bison from https://sourceforge.net/projects/winflexbison/
95
	   and unpack them on your disk.
96
	2. Download the Adobe Photoshop SDK from https://www.adobe.com/devnet/photoshop/sdk.html
97
	   and unpack it on your disk.
98
	3. Download the Telegraphics common library from http://telegraphics.com.au/svn/common/trunk/
99
	   and unpack it on your disk. Please make sure that "common" and "Source" (of FilterFoundry)
100
	   are placed in the same directory.
177 dmarschall 101
	4. Download the Windows SDK https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
102
	   and install the following components:
103
	   - Windows SDK for Desktop C++ x86 Apps
104
	   - Windows SDK for Desktop C++ amd64 Apps
105
	5. a) If you want to use the IDE:
172 dmarschall 106
	      - Open the visual_studio\FilterFoundry.sln
107
	      - Adjust the paths in the project settings:
108
	        Path to Adobe plugin SDK (in C/C++ category, and Resource category)
109
	        Path to win_flex and win_bison (pre-build-events)
177 dmarschall 110
	        Your specific version of the Windows SDK
172 dmarschall 111
	      - You can now compile the x86 and x64 plugin inside the IDE.
112
	   b) If you want to use CLI/nmake:
113
	      - Adjust the paths in the visual_studio\nmake.mak and visual_studio\nmake64.mak files:
114
	        Path to Adobe plugin SDK (in C/C++ category, and Resource category)
115
	        Path to win_flex and win_bison (pre-build-events)
116
	      - Edit visual_studio\vc_make_3264.bat: Change the Visual Studio path to the one you have on your system.
117
	      - You can now use the script visual_studio\vc_make_3264.bat to build both x86 and x64 with one click.
106 dmarschall 118
 
172 dmarschall 119
	Troubleshooting:
120
	- If "rc" can't be found, install the Windows 10 SDK, and then copy
121
	  C:\Program Files (x86)\Windows Kits\10\bin\...\x64 to C:\Program Files (x86)\Windows Kits\10\bin\x86
122
	  see also https://stackoverflow.com/questions/43847542/rc-exe-no-longer-found-in-vs-2015-command-prompt
123
	- If lex.yy.c can't be found, check the flex command (it generates lex.yy.c)
124
	- If nmake gives the error message "makefile(28) : fatal error U1000: Syntax error: ")" missing in macro invocation"
125
	  then run nmake with the parameter "/f nmake.mak" or "/f nmake64.mak"
126
	  (nmake calls Makefile by default, which is not optimized for nmake)
127
	- If you run into any problems, try "nmake /f nmake.mak clean" followed by "nmake /f nmake.mak",
128
	  or for 64 bit: "nmake /f nmake64.mak clean" followed by "nmake /f nmake64.mak"
129
	  It is necessary to run the "clean" command when switching between 32bit and 64 bit building.
177 dmarschall 130
	- Since the RC files have a complex structure, you cannot edit the resources inside the IDE.
131
	  You need to edit the *.rc files manually.
106 dmarschall 132
 
172 dmarschall 133
BUILDING WITH OPEN WATCOM
134
(Most recently tested with Open Watcom 1.9 with Adobe Photoshop SDK CC 2017):
106 dmarschall 135
 
172 dmarschall 136
	To build in Windows with the OpenWatcom IDE, see the wpj
137
	subdirectory and notes (README.TXT) kindly provided by Peter Heckert and Daniel Marschall.
106 dmarschall 138
 
107 dmarschall 139
 
2 toby 140
Development systems
64 toby 141
-------------------
2 toby 142
While a CodeWarrior 7 project is provided, MPW and mingw32 are recommended 
143
as they produce much smaller executables.
144
 
69 toby 145
Mingw32 (http://www.mingw.org/) can be hosted on virtually any UNIX or
146
Linux system, or under Windows.
2 toby 147
 
69 toby 148
MPW (http://developer.apple.com/tools/mpw-tools/) runs on PowerPC and
149
68K Macs under Mac OS 9 or earlier, or Classic under OS X.
109 dmarschall 150
 
151
For Windows, Visual Studio works best (the community edition is even free),
152
and it can compile the 32-Bit and 64-Bit plugin for Windows.
153
OpenWatcom can also be used, but only for 32 Bit, and it is officially not
154
supported by Adobe.