1#!amake 2# 3# Makefile to compile sswf (Script to SWF) with amake 4# Written by Alexis Wilke for Made to Order Software Corp. (c) 2002-2009 5# 6# Copyright (c) 2002-2009 Made to Order Software Corp. 7# 8# Permission is hereby granted, free of charge, to any 9# person obtaining a copy of this software and 10# associated documentation files (the "Software"), to 11# deal in the Software without restriction, including 12# without limitation the rights to use, copy, modify, 13# merge, publish, distribute, sublicense, and/or sell 14# copies of the Software, and to permit persons to whom 15# the Software is furnished to do so, subject to the 16# following conditions: 17# 18# The above copyright notice and this permission notice 19# shall be included in all copies or substantial 20# portions of the Software. 21# 22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 23# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 24# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 25# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 26# EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 29# ARISING FROM, OUT OF OR IN CONNECTION WITH THE 30# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31# SOFTWARE. 32# 33 34# Get the version from the libsswf-version.h file instead (we thus avoid 35# data duplication) 36#VERSION=x.y.z 37# The following ensures we can extract the version, it's not 100% 38# correct since if a 2nd number with the same form appears in the 39# version file then it will be returned too 40LIBSSWF_VERSION<=include/sswf/libsswf-version.h 41VERSION:=$(LIBSSWF_VERSION::[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*) 42 43 44# Let's ensure that all the necessary directories 45# exist from the start; this makes amake happier; 46# in MS-Windows 2000 you can test if a file exists 47# I'm not sure that's valid under older versions 48#for p in modules bin lib VC \ 49 tmp\backup\src\tools tmp\object\src\tools \ 50 tmp\backup\src\sswf tmp\object\src\sswf \ 51 tmp\backup\src\misc tmp\object\src\misc \ 52 tmp\backup\src\lib tmp\object\src\lib \ 53 tmp\backup\src\libas tmp\object\src\libas \ 54 tmp\backup\src\libasas tmp\object\src\libasas \ 55 tmp\backup\src\libasc tmp\object\src\libasc 56#shell if not exist $p mkdir $p 57#endfor 58 59# For cl we need to copy some header files... 60#for p in include\jconfig.h include\jpeglib.h \ 61 include\jerror.h include\jmorecfg.h include\zconf.h \ 62 include\zlib.h include\iconv.h include\ft2build.h 63#shell if not exist $p copy ..\..\..\..\$p include 64#endfor 65 66#shell sed -e "s/#if 1/#if 0/" include\zconf.h >tmp\zconf.h 67#shell copy tmp\zconf.h include 68 69CINCLUDEPATH:=include;src/sswf 70CSUFFIXES:=.c .c++ .cpp .cxx .h .h++ .hpp .s .S .l .y 71 72CC:=cl #gcc 73CXX:=cl #g++ 74LD:=ld 75# This includes folders that are specific to my computer. 76CFLAGS:=/O2 /GR /I/AllDev/MinGW/3.3/include/freetype2 /I"/AllDev/Microsoft Visual Studio 8/VC/include" /I"/AllDev/Microsoft Visual Studio 8/include" /DDEBUG=1 /DYYDEBUG=1 /D_MSVC=1 /DWIN32 /DBYTE_ORDER=1 /DLITTLE_ENDIAN=1 /DBIG_ENDIAN=0 /Iinclude 77CXXFLAGS:=$(CFLAGS) 78COPY:=cp -f 79RENAME:=rename 80RM:=rm -r 81RMDIR:=rmdir /s /q 82MKDIR:=mkdir 83AR:=ar 84YFLAGS:=-t # enable -t for debug 85BISON:=bison 86 87LIBSRC:=$(wildcard src\lib\libsswf_*.c++) 88LIBASSRC:=$(wildcard src\libas\*.c++) 89LIBASASSRC:=$(wildcard src\libasas\*.c++) 90RAWSSWFSRC:=$(wildcard src\sswf\*.[cy]*) 91SSWFSRC:=$(RAWSSWFSRC:-*~) # no backup (some people will use ~ at the end of filenames) 92TOOLSSRC:=$(wildcard src\tools\*.c) $(wildcard src\tools\*.c++) 93MISCSRC:=$(wildcard src\misc\*.c) 94 95LIBOBJ:=$(LIBSRC:*.c++=tmp\\object\\*.obj:U) 96LIBASOBJ:=$(LIBASSRC:*.c++=tmp\\object\\*.obj:U) 97LIBASASOBJ:=$(LIBASASSRC:*.c++=tmp\\object\\*.obj:U) 98LIBASCOBJ:=$(LIBASCSRC:*.c++=tmp\\object\\*.obj:U) 99SSWFOBJ:=$(SSWFSRC:*.*=tmp\\object\\*.obj:U) 100TOOLSOBJ:=$(TOOLSSRC:*.*=tmp\\object\\*.obj:U) 101MISCOBJ:=$(MISCSRC:*.*=tmp\\object\\*.obj:U) 102 103 104 105 106OBJ:=$(LIBOBJ) $(LIBASOBJ) $(LIBASASOBJ) $(SSWFOBJ) $(TOOLSOBJ) $(MISCOBJ) 107all: $(OBJ) .PHONY 108 @echo "Done!" 109 110 111 112 113 114 115ALLSRC:=$(LIBSRC) $(LIBASSRC) $(LIBASASSRC) $(LIBASCSRC) $(SSWFSRC) $(TOOLSSRC) $(MISCSRC) 116ALLCXXOBJ:=$(ALLSRC::*.c++=tmp\\object\\*.obj) 117ALLCOBJ:=$(ALLSRC::*.c=tmp\\object\\*.obj) 118ALLYACCOBJ:=$(ALLSRC::*.y=tmp\\object\\*.obj) 119ALLLEXOBJ:=$(ALLSRC::*.l=tmp\\object\\*.obj) 120 121 122 123$(ALLCXXOBJ): $(.TARGET:tmp\\object\\*.obj=*.c++) 124 $(CXX) /c $(CXXFLAGS) /I$(.TARGET:tmp\\object\\*\\*\\*.obj=tmp\\object\\*\\*) /Fo$(.TARGET) /Tp $(.FIRSTSRC) 125 126$(ALLCOBJ): $(.TARGET:tmp\\object\\*.obj=*.c) 127 $(CC) /c $(CFLAGS) /Fo$(.TARGET) /Tc $(.FIRSTSRC) 128 129 130tmp/object/src/sswf/%.obj: tmp/object/src/sswf/%.c 131 $(CC) /c $(CFLAGS) -Isrc/sswf /Fo$(.TARGET) /Tc $(.IMPSRC) 132 133tmp/object/src/sswf/%.c tmp/object/src/sswf/%.h: src/sswf/%.y .PRECIOUS 134 $(BISON) -v -d $(YFLAGS) -b $(.TARGET:R) $(.IMPSRC) /Fo$(.TARGET:*.h=*.c) 135 136 137 138 139 140 141 142 143 144clobber: rmtarget .PHONY 145 -$(RMDIR) tmp 2>ignore.tmp 146 -$(RM) .amakeautodepend 147 @echo "Output packages not removed with amake clobber" 148 149clean cleaup: rmtarget .PHONY 150 -$(RMDIR) tmp/object 2>ignore.tmp 151 152rmtarget: .PHONY 153 -$(RMDIR) lib bin 2>ignore.tmp 154 -$(RM) core 2>ignore.tmp 155 156 157