# This file is part of pathlength, a Filter plugin for Adobe Illustrator # Copyright (C) 1995-2005 Toby Thain, toby@telegraphics.com.au # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # mingw32 Makefile MINGW_CC = i386-mingw32msvc-gcc DLLWRAP = i386-mingw32msvc-dllwrap WINDRES = i386-mingw32msvc-windres # parts of Mac OS X plugin bundle to build PLUGIN_OSX = pathlength_cs2.bundle/Contents/MacOS/pathlength PLUGIN_RSRC = pathlength_cs2.bundle/Contents/Resources/pathlength.rsrc DLL7 = pathlength-ai7.aip DLL10 = pathlength-ai10.aip DISTARCHIVE = pathlength-win.zip all : dll osx # 'dll' target builds two Win32 DLLs - one for AI7 & later, one for AI10 and later dll : $(DLL7) $(DLL10) # 'osx' target builds Mach-O bundle for AI CS2 on OS X **not yet tested** osx : $(PLUGIN_OSX) $(PLUGIN_RSRC) API7 = ../Illustrator70.SDK/AIPluginAPI API10 = ../ai10sdk/IllustratorAPI APICS2 = ../aics2sdkw/IllustratorAPI # we need PITypes.h from Photoshop API for choosefile,compat_win stuff PSAPI=../PhotoshopAPI CFLAGS += -Wall -Wno-unknown-pragmas -O2 CPPFLAGS += -DISFILTER \ -I../common/adobeplugin -I../common/tt \ -I$(PSAPI)/Photoshop $(DLL7) : CPPFLAGS += \ -DWIN_ENV \ -I$(API7)/"ADM Headers" -I$(API7)/"Adobe Illustrator Headers" \ -I$(API7)/"General Headers" -I$(API7)/"Legacy Headers" \ -I$(API7)/"PICA SP Headers" -I$(API7)/"Undocumented Headers" $(DLL10) : CPPFLAGS += \ -DWIN_ENV \ -I$(API10)/ADM -I$(API10)/Illustrator \ -I$(API10)/General -I$(API10)/Legacy/v7 \ -I$(API10)/PICA_SP $(PLUGIN_OSX) : CPPFLAGS += \ -DMAC_ENV -DMACMACHO \ -I$(APICS2)/Illustrator \ -I$(APICS2)/Illustrator/legacy \ -I$(APICS2)/PICA_SP \ -I$(APICS2)/ADM \ -I$(APICS2)/ADM/legacy OBJ7 = obj7_w32/aipluginmain.o obj7_w32/main.o OBJ10 = obj10_w32/aipluginmain.o obj10_w32/main.o OBJCOMMON = obj_w32/dbg_win.o obj_w32/str.o OBJ_OSX = objcs2/aipluginmain.o objcs2/main.o \ objcs2/dbg_mac.o objcs2/str.o # Win32 (x86) objects obj_w32/%.o : %.c $(MINGW_CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) obj7_w32/%.o : %.c $(MINGW_CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) obj10_w32/%.o : %.c $(MINGW_CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) # OS X (Mach-O) objects objcs2/%.o : %.c $(CXX) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) vpath %.c ../common/adobeplugin ../common/tt obj7_w32/main.o : common.h version.h obj10_w32/main.o : common.h version.h dist : $(DISTARCHIVE) $(DISTARCHIVE) : $(DLL7) $(DLL10) README.txt COPYING.txt zip -9 $@ $^ ls -l $@ clean : rm -f $(DLL7) $(DLL10) $(OBJ7) $(OBJ10) $(OBJ_OSX) $(OBJCOMMON) $(PLUGIN_OSX) $(PLUGIN_RSRC) res.o # compile Mac 'PiPL' resource $(PLUGIN_RSRC) : PiPL_macho.r /Developer/Tools/Rez -o $@ $^ # final link step for OS X Mach-O executable $(PLUGIN_OSX) : exports.exp $(OBJ_OSX) $(PLUGIN_RSRC) $(CXX) -o $@ $(OBJ_OSX) -exported_symbols_list exports.exp \ -e _main -bundle -framework Carbon -framework System #-Wl,-M /Developer/Tools/SetFile -a B pathlength_cs2.bundle ls -l $@ $(DLL7) : exports.def $(OBJ7) $(OBJCOMMON) res.o $(DLLWRAP) -o $@ -def $^ -s -mwindows ls -l $@ $(DLL10) : exports.def $(OBJ10) $(OBJCOMMON) res.o $(DLLWRAP) -o $@ -def $^ -s -mwindows ls -l $@ res.o : PiPL.rc $(WINDRES) -i $^ -o $@