-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from FLIF-hub/master
Update from FLIF-Hub
- Loading branch information
Showing
81 changed files
with
3,569 additions
and
2,336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*/ | ||
|
||
*.zip | ||
*.dll | ||
*.exe | ||
|
||
!getopt/ | ||
|
||
!include/ | ||
include/* | ||
!include/sdl2v140.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
lpngdir = lpng1618 | ||
zlibdir = zlib-1.2.8 | ||
sdl2dir = SDL2-2.0.3 | ||
|
||
Incdir = include | ||
|
||
!ifndef PLATFORM | ||
PLATFORM=x86 | ||
!endif | ||
|
||
Rt = MD | ||
LibDir = $(PLATFORM)_$(Rt) | ||
SrcDir = ..\..\src | ||
|
||
!if "$(Rt)" == "MT" || "$(Rt)" == "MD" | ||
CFLAGS = /nologo /WX /EHsc /GL /Ox /Oy /Gy /DNDEBUG /$(Rt) | ||
LDFLAGS= /nologo /LTCG | ||
!elseif "$(Rt)" == "MTd" || "$(Rt)" == "MDd" | ||
CFLAGS = /nologo /WX /EHsc /Zi /DDEBUG /$(Rt) | ||
LDFLAGS= /nologo /DEBUG | ||
!else | ||
!ERROR Rt=[MT|MD|MTd|MDd] | ||
!endif | ||
|
||
OBJDIR = $(LibDir)\Obj | ||
O = $(OBJDIR)\\ | ||
|
||
OBJ1 = $Oflif-dec.obj $Oflif-enc.obj $Oio.obj $Ocommon.obj $Ocolor_range.obj $Ocrc32k.obj $Obit.obj $Ochance.obj $Ofactory.obj | ||
OBJ2 = $Oimage.obj $Oimage-pam.obj $Oimage-png.obj $Oimage-pnm.obj $Oimage-rggb.obj | ||
LIBOBJS = $(OBJ1) | ||
FLIFOBJS = $(OBJ1) $(OBJ2) | ||
|
||
flif.exe: $(OBJDIR) $(LibDir)\zlib.lib $(LibDir)\libpng.lib $(FLIFOBJS) | ||
cl $(CFLAGS) /I$(Incdir) /Igetopt $(SrcDir)\flif.cpp getopt\getopt.c /DSTATIC_GETOPT /Fd$O /Fo$O -c | ||
link /out:$(LibDir)\$@ $Oflif.obj $Ogetopt.obj $(FLIFOBJS) $(LibDir)\zlib.lib $(LibDir)\libpng.lib $(LDFLAGS) | ||
copy "$(LibDir)\$@" $@ | ||
|
||
libflif.dll: $(OBJDIR) $(LIBOBJS) | ||
cl $(CFLAGS) $(SrcDir)\flif-interface.cpp /DFLIF_BUILD_DLL /Fd$O /Fo$O -c | ||
link /dll /out:"$(LibDir)\$@" $Oflif-interface.obj $(LIBOBJS) $(LDFLAGS) | ||
copy "$(LibDir)\$@" $@ | ||
|
||
viewflif.exe: libflif.dll | ||
cl $(CFLAGS) /I$(SrcDir)\ /I$(sdl2dir)\include /Tp $(SrcDir)\viewflif.c /FI..\build\MSVC\$(Incdir)\sdl2v140.h /DFLIF_USE_DLL /Fd$O /Fo$O -c | ||
link /out:$(LibDir)\$@ $Oviewer.obj libflif.lib SDL2.lib SDL2main.lib $(LDFLAGS) /SUBSYSTEM:CONSOLE /LIBPATH:$(LibDir) /LIBPATH:$(sdl2dir)\lib\$(PLATFORM)\ | ||
copy "$(LibDir)\$@" $@ | ||
copy $(sdl2dir)\lib\$(PLATFORM)\SDL2.dll SDL2.dll | ||
|
||
test: test-interface.exe | ||
if exist output.flif del output.flif | ||
@echo ./flif.exe ../../tools/kodim01.png output.flif | ||
@powershell "Measure-Command{ ./flif.exe ../../tools/kodim01.png output.flif}" | ||
if exist output.png del output.png | ||
flif output.flif output.png | ||
@if exist "viewflif.exe" viewflif.exe output.flif | ||
@if not exist "testFiles/" mkdir testFiles | ||
if exist "test-interface.exe" test-interface.exe | ||
start output.png | ||
|
||
test-interface.exe: libflif.dll | ||
cl $(CFLAGS) /I$(Incdir) /I$(SrcDir)\ ..\..\tools\test.c /DFLIF_USE_DLL /Fd$O /Fo$O -c | ||
link /out:$(LibDir)\$@ $Otest.obj libflif.lib $(LDFLAGS) /LIBPATH:$(LibDir) | ||
copy "$(LibDir)\$@" $@ | ||
|
||
$(OBJDIR): | ||
@if not exist "$(@)/" mkdir "$(@)" | ||
|
||
$(LibDir)\zlib.lib: $(OBJDIR) | ||
cd $(zlibdir) | ||
@nmake -f win32\Makefile.msc clean | ||
nmake -f win32\Makefile.msc zlib.lib CFLAGS="$(CFLAGS) /TC /Fdzlib" ARFLAGS="$(LDFLAGS)" | ||
copy zlib.lib ..\$(LibDir)\\ | ||
copy zlib.h ..\$(Incdir)\\ | ||
copy zconf.h ..\$(Incdir)\\ | ||
cd .. | ||
|
||
$(LibDir)\libpng.lib: $(LibDir)\zlib.lib | ||
cd $(lpngdir) | ||
@nmake -f scripts\Makefile.vcwin32 clean | ||
nmake -f scripts\Makefile.vcwin32 libpng.lib CPPFLAGS="/I..\$(Incdir) " CFLAGS="$(CFLAGS) /TC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS" ARFLAGS="$(LDFLAGS)" | ||
copy libpng.lib ..\$(LibDir)\\ | ||
copy png.h ..\$(Incdir)\\ | ||
copy pngconf.h ..\$(Incdir)\\ | ||
copy pnglibconf.h ..\$(Incdir)\\ | ||
cd .. | ||
|
||
{$(SrcDir)\}.cpp{$(O)}.obj: | ||
cl $(CFLAGS) /Fd$O /Fo$O -c $< | ||
{getopt\}.c{$(O)}.obj: | ||
cl $(CFLAGS) /DSTATIC_GETOPT /Fd$O /Fo$O -c $< | ||
{$(SrcDir)\image\}.cpp{$(O)}.obj: | ||
cl $(CFLAGS) /I$(Incdir) /Fd$O /Fo$O -c $< | ||
{$(SrcDir)\maniac\}.cpp{$(O)}.obj: | ||
cl $(CFLAGS) /Fd$O /Fo$O -c $< | ||
{$(SrcDir)\transform\}.cpp{$(O)}.obj: | ||
cl $(CFLAGS) /Fd$O /Fo$O -c $< | ||
|
||
all: flif.exe viewflif.exe test-interface.exe | ||
|
||
clean: | ||
-del flif.exe | ||
-del test-interface.exe | ||
-del viewflif.exe | ||
-del SDL2.dll | ||
-del libflif.dll | ||
-del output.png | ||
-del output.flif | ||
-rd /s /q testFiles | ||
-rd /s /q $(LibDir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@echo off | ||
|
||
set lpngurl=http://sourceforge.net/projects/libpng/files/libpng16/1.6.18/lpng1618.zip/download | ||
set lpngzip=lpng1618.zip | ||
set lpngdir=lpng1618 | ||
|
||
set zliburl=http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib128.zip/download | ||
set zlibzip=zlib128.zip | ||
set zlibdir=zlib-1.2.8 | ||
|
||
set sdl2url=https://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip | ||
set sdl2zip=SDL2-devel-2.0.3-VC.zip | ||
set sdl2dir=SDL2-2.0.3 | ||
|
||
|
||
if not defined VISUALSTUDIOVERSION ( | ||
CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %1 | ||
) | ||
if not defined VISUALSTUDIOVERSION ( | ||
echo need VS2015 | ||
goto end | ||
) | ||
if not defined PLATFORM set PLATFORM=x86 | ||
|
||
cd /d %~dp0 | ||
|
||
if not exist "%lpngzip%" ( | ||
echo download %lpngzip% | ||
PowerShell "(New-Object System.Net.WebClient).DownloadFile('%lpngurl%', '%lpngzip%')" | ||
) | ||
if not exist "%lpngdir%\\" ( | ||
echo unzip %lpngzip% | ||
PowerShell "(New-Object -ComObject shell.application).NameSpace('%CD%').CopyHere((New-Object -ComObject shell.application).NameSpace('%CD%\%lpngzip%').Items())" | ||
) | ||
|
||
if not exist "%zlibzip%" ( | ||
echo download %zlibzip% | ||
PowerShell "(New-Object System.Net.WebClient).DownloadFile('%zliburl%', '%zlibzip%')" | ||
) | ||
if not exist "%zlibdir%\\" ( | ||
echo unzip %zlibzip% | ||
PowerShell "$s=New-Object -Com shell.application;$s.NameSpace('%CD%').CopyHere($s.NameSpace('%CD%\%zlibzip%').Items())" | ||
) | ||
|
||
if not exist "%sdl2zip%" ( | ||
echo download %sdl2zip% | ||
PowerShell "(New-Object System.Net.WebClient).DownloadFile('%sdl2url%', '%sdl2zip%')" | ||
) | ||
if not exist "%sdl2dir%\\" ( | ||
echo unzip %sdl2zip% | ||
PowerShell "$s=New-Object -Com shell.application;$s.NameSpace('%CD%').CopyHere($s.NameSpace('%CD%\%sdl2zip%').Items())" | ||
) | ||
|
||
nmake Rt=MD | ||
nmake Rt=MD test | ||
rem nmake Rt=MT flif.exe | ||
rem debug MTd|MDd | ||
rem nmake Rt=MDd all | ||
|
||
:end | ||
cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
cd /d %~dp0 | ||
call dl_make_vs.bat amd64 |
Oops, something went wrong.